- Timestamp:
- Jan 26, 2010, 5:10:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.stack.20100120/src/psphotSourceSize.c
r26681 r26688 16 16 17 17 // local functions: 18 bool psphotSourceSizeReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index);19 18 bool psphotSourceSizePSF (psphotSourceSizeOptions *options, psArray *sources, pmPSF *psf); 20 19 bool psphotSourceClass (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, psphotSourceSizeOptions *options); … … 31 30 32 31 // for now, let's store the detections on the readout->analysis for each readout 33 bool psphotSourceSize (pmConfig *config, const pmFPAview *view )32 bool psphotSourceSize (pmConfig *config, const pmFPAview *view, bool getPSFsize) 34 33 { 35 34 bool status = true; … … 44 43 // loop over the available readouts 45 44 for (int i = 0; i < num; i++) { 46 if (!psphotSourceSizeReadout (config, view, "PSPHOT.INPUT", i, recipe )) {45 if (!psphotSourceSizeReadout (config, view, "PSPHOT.INPUT", i, recipe, getPSFsize)) { 47 46 psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i); 48 47 return false; … … 52 51 } 53 52 54 // XXXuse an internal flag to mark sources which have already been measured55 bool psphotSourceSizeReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe )53 // this function use an internal flag to mark sources which have already been measured 54 bool psphotSourceSizeReadout(pmConfig *config, const pmFPAview *view, const char *filename, int index, psMetadata *recipe, bool getPSFsize) 56 55 { 57 56 bool status; … … 67 66 psAssert (readout, "missing readout?"); 68 67 69 psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES"); 68 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 69 psAssert (detections, "missing detections?"); 70 71 psArray *sources = detections->allSources; 70 72 psAssert (sources, "missing sources?"); 71 73 … … 116 118 // XXX move this to the code that generates the PSF? 117 119 // XXX store the results on pmPSF? 118 psphotSourceSizePSF (&options, sources, psf); 120 121 // XXX this should only be done on the first pass (ie, if we have newSources or allSources?) 122 if (getPSFsize) { 123 psphotSourceSizePSF (&options, sources, psf); 124 } 119 125 120 126 // classify the sources based on ApResid and Moments (extended sources) 127 // NOTE: only sources not already measured !(source->tmpFlags & PM_SOURCE_TMPF_SIZE_MEASURED) 121 128 psphotSourceClass(readout, sources, recipe, psf, &options); 122 129 130 // NOTE: only sources not already measured !(source->tmpFlags & PM_SOURCE_TMPF_SIZE_MEASURED) 123 131 psphotSourceSizeCR (readout, sources, &options); 124 132 … … 376 384 for (int i = 0; i < sources->n; i++) { 377 385 pmSource *source = sources->data[i]; 386 387 // skip source if it was already measured 388 if (source->tmpFlags & PM_SOURCE_TMPF_SIZE_MEASURED) { 389 psTrace("psphot", 7, "Not calculating source size since it has already been measured\n"); 390 continue; 391 } 378 392 379 393 // Integer position of peak
Note:
See TracChangeset
for help on using the changeset viewer.
