Changeset 33761
- Timestamp:
- Apr 11, 2012, 11:56:11 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
ippconfig/recipes/psphot.config (modified) (2 diffs)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotFindDetections.c (modified) (2 diffs)
-
psphot/src/psphotFindPeaks.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/recipes/psphot.config
r33642 r33761 57 57 PEAKS_POS2_NSIGMA_LIMIT F32 25.0 # peak signficance threshold for POS2 sources. (ppSub) 58 58 # input pixels contribute less than this fraction of the flux 59 PEAKS_NMAX_TOTAL S32 0 # maximum allowed number of peaks 0 == unlimited 60 59 61 # parameters which adjust the footprint analysis 60 62 USE_FOOTPRINTS BOOL TRUE # use new pmFootprint peak packaging … … 368 370 PSF_MODEL STR PS_MODEL_GAUSS 369 371 EXT_MODEL STR PS_MODEL_QGAUSS 372 PEAKS_NMAX_TOTAL S32 50000 # maximum allowed number of peaks - To avoid memory explosion 370 373 END 371 374 -
trunk/psphot/src/psphot.h
r33690 r33761 189 189 // used by psphotFindDetections 190 190 pmReadout *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, psImageMaskType maskVal); 191 psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax );191 psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax, int *totalPeaks); 192 192 bool psphotFindFootprints (pmDetections *detections, pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int pass, psImageMaskType maskVal); 193 193 psErrorCode psphotCullPeaks(const pmReadout *readout, const pmReadout *signifRO, const psMetadata *recipe, psArray *footprints); -
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 } -
trunk/psphot/src/psphotFindPeaks.c
r32348 r33761 4 4 // image must be constructed to represent (S/N)^2. If nMax is non-zero, only return a maximum 5 5 // of nMax peaks 6 psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax ) {6 psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax, int *totalPeaks) { 7 7 8 8 bool status = false; … … 18 18 psError(PSPHOT_ERR_DATA, false, "no peaks found in this image"); 19 19 return NULL; 20 } 21 // return the total number of peaks found before the nMax limit is applied 22 if (totalPeaks) { 23 *totalPeaks = peaks->n; 20 24 } 21 25
Note:
See TracChangeset
for help on using the changeset viewer.
