IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27314 for trunk/psphot


Ignore:
Timestamp:
Mar 17, 2010, 4:01:19 PM (16 years ago)
Author:
eugene
Message:

fixes for psphotForced

Location:
trunk/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotForcedReadout.c

    r26894 r27314  
    5858    psphotGuessModels (config, view);
    5959
     60    // merge the newly selected sources into the existing list
     61    // NOTE: merge OLD and NEW
     62    psphotMergeSources (config, view);
     63
    6064    // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
    6165    psphotFitSourcesLinear (config, view, false);
  • trunk/psphot/src/psphotMergeSources.c

    r26894 r27314  
    8585
    8686    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
    87     psAssert (detections, "missing detections?");
    88 
    89     // XXX allSources or newSources?
    90     psArray *sources = detections->allSources;
     87    if (!detections) {
     88        detections = pmDetectionsAlloc();
     89        detections->newSources = psArrayAllocEmpty (100);
     90        // save detections on the readout->analysis
     91        if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot detections", detections)) {
     92            psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout");
     93            return false;
     94        }
     95    } else {
     96        psMemIncrRefCounter(detections); // so we can free the detections below
     97    }
     98
     99    psArray *sources = detections->newSources;
    91100    psAssert (sources, "missing sources?");
    92101
     
    110119                source->modelPSF = NULL;
    111120
    112                 psArrayAdd (detections->allSources, 100, source);
     121                psArrayAdd (detections->newSources, 100, source);
    113122            }
    114123        }
     
    132141                source->modelPSF = NULL;
    133142
    134                 psArrayAdd (detections->allSources, 100, source);
     143                psArrayAdd (detections->newSources, 100, source);
    135144            }
    136145        }
     
    138147
    139148finish:
     149
     150    psFree (detections);
    140151
    141152    if (!extCMF && !extSourcesTXT) {
Note: See TracChangeset for help on using the changeset viewer.