Changeset 20177
- Timestamp:
- Oct 15, 2008, 11:14:18 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFindDetections.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFindDetections.c
r19910 r20177 20 20 // on first pass, detections have not yet been allocated 21 21 if (!detections) { 22 detections = pmDetectionsAlloc();23 pass = 1;22 detections = pmDetectionsAlloc(); 23 pass = 1; 24 24 NSIGMA_PEAK = psMetadataLookupF32 (&status, recipe, "PEAKS_NSIGMA_LIMIT"); PS_ASSERT (status, NULL); 25 25 NMAX = psMetadataLookupS32 (&status, recipe, "PEAKS_NMAX"); PS_ASSERT (status, NULL); 26 26 } else { 27 pass = 2;27 pass = 2; 28 28 NSIGMA_PEAK = psMetadataLookupF32 (&status, recipe, "PEAKS_NSIGMA_LIMIT_2"); PS_ASSERT (status, NULL); 29 NMAX = 0; // unlimited number of peaks in final pass: allow a limit (PEAKS_NMAX_2) ?29 NMAX = 0; // unlimited number of peaks in final pass: allow a limit (PEAKS_NMAX_2) ? 30 30 } 31 31 32 32 float threshold = PS_SQR(NSIGMA_PEAK); 33 33 34 // move the old peaks array (if it exists) to oldPeaks 34 // move the old peaks array (if it exists) to oldPeaks 35 35 // XXX generically, we should be able to call this function an arbitrary number of times 36 36 assert (detections->oldPeaks == NULL); … … 47 47 detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX); 48 48 psMetadataAddF32 (recipe, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold); 49 if (!detections->peaks) { 50 // No peaks found 51 return NULL; 52 } 49 53 50 54 // optionally merge peaks into footprints 51 55 if (useFootprints) { 52 psphotFindFootprints (detections, significance, readout, recipe, pass, maskVal);56 psphotFindFootprints (detections, significance, readout, recipe, pass, maskVal); 53 57 } 54 58
Note:
See TracChangeset
for help on using the changeset viewer.
