Changeset 33761 for trunk/psphot/src/psphotFindDetections.c
- Timestamp:
- Apr 11, 2012, 11:56:11 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFindDetections.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFindDetections.c
r32348 r33761 96 96 97 97 // detect the peaks in the significance image 98 detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX); 98 int totalPeaks = 0; 99 detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX, &totalPeaks); 99 100 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold); 100 101 if (!detections->peaks) { … … 103 104 psFree (detections); 104 105 psError (PSPHOT_ERR_CONFIG, false, "failed on peak search"); 106 return false; 107 } 108 // hard limit on number of peaks we will accept. (To avoid memory overload in psphotStack) 109 int maxPeaks = psMetadataLookupS32 (&status, recipe, "PEAKS_NMAX_TOTAL"); PS_ASSERT (status, NULL); 110 if (maxPeaks && (totalPeaks > maxPeaks)) { 111 psFree (detections); 112 psError (PSPHOT_ERR_DATA, true, "Too many peaks %d found PEAKS_NMAX_TOTAL: %d", totalPeaks, maxPeaks); 105 113 return false; 106 114 }
Note:
See TracChangeset
for help on using the changeset viewer.
