Changeset 27657 for trunk/psphot/src/psphotSourceStats.c
- Timestamp:
- Apr 11, 2010, 5:08:29 PM (16 years ago)
- Location:
- trunk/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
-
Property svn:mergeinfo
set to
/branches/eam_branches/stackphot.20100406/psphot merged eligible
-
Property svn:mergeinfo
set to
-
trunk/psphot/src
- Property svn:ignore
-
old new 21 21 psphotForced 22 22 psphotMakePSF 23 psphotStack
-
- Property svn:ignore
-
trunk/psphot/src/psphotSourceStats.c
r27571 r27657 2 2 3 3 // convert detections to sources and measure their basic properties (moments, local sky, sky 4 // variance) Note: this function only generates sources for the new peaks (peak->assigned) 4 // variance) Note: this function only generates sources for the new peaks (peak->assigned). 5 // The new sources are added to any existing sources on detections->newSources. The sources 6 // on detections->allSources are ignored. 5 7 bool psphotSourceStats (pmConfig *config, const pmFPAview *view, bool setWindow) 6 8 { … … 40 42 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 41 43 psAssert (detections, "missing detections?"); 42 psAssert (!detections->newSources, "new sources already defined?");43 44 44 45 // XXX TEST: … … 84 85 85 86 // generate the array of sources, define the associated pixel 86 sources = psArrayAllocEmpty (peaks->n); 87 if (!detections->newSources) { 88 detections->newSources = psArrayAllocEmpty (peaks->n); 89 } 90 sources = detections->newSources; 87 91 88 92 // if there are no peaks, we save the empty source array and return 89 93 if (!peaks->n) { 90 // save the new sources on the detection structure:91 detections->newSources = sources;92 94 return true; 93 95 } … … 100 102 // create a new source 101 103 pmSource *source = pmSourceAlloc(); 104 source->imageID = index; 102 105 103 106 // add the peak … … 119 122 psLogMsg ("psphot", PS_LOG_INFO, "break point PEAKS, skipping MOMENTS\n"); 120 123 psphotVisualShowMoments (sources); 121 detections->newSources = sources;122 124 return true; 123 125 } … … 126 128 if (!psphotSetMomentsWindow(recipe, readout->analysis, sources)) { 127 129 psError(PS_ERR_UNEXPECTED_NULL, false, "Failed to determine Moments Window!"); 128 psFree( sources);130 psFree(detections->newSources); 129 131 return false; 130 132 } … … 178 180 psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS"); 179 181 psFree (job); 180 psFree( sources);182 psFree(detections->newSources); 181 183 return false; 182 184 } … … 187 189 if (!psThreadPoolWait (false)) { 188 190 psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS"); 189 psFree(sources);191 psFree(detections->newSources); 190 192 return false; 191 193 } … … 215 217 psphotVisualShowMoments (sources); 216 218 217 // save the new sources on the detection structure:218 detections->newSources = sources;219 220 221 219 if (detections->allSources) { 222 220 psphotMaskCosmicRayFootprintCheck(detections->allSources); … … 377 375 pmSource *source = sources->data[i]; 378 376 377 if (source->tmpFlags & PM_SOURCE_TMPF_MOMENTS_MEASURED) continue; 378 source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED; 379 379 380 // skip faint sources for moments measurement 380 381 if (source->peak->SN < MIN_SN) {
Note:
See TracChangeset
for help on using the changeset viewer.
