- Timestamp:
- Jun 19, 2012, 5:24:19 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotFindDetections.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20111122/psphot merged: 33070-33071,33086,33088,33094-33095,33612,33640 /branches/eam_branches/ipp-20120405/psphot (added) merged: 33946,33953
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psphot/src
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psphot/src/psphotFindDetections.c
r33415 r34041 48 48 // Use the new pmFootprints approach? 49 49 const bool useFootprints = psMetadataLookupBool(NULL, recipe, "USE_FOOTPRINTS"); 50 const bool footprintUseUnsubtracted = psMetadataLookupBool(NULL, recipe, "FOOTPRINT_USE_UNSUBTRACTED"); 50 51 51 52 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); … … 64 65 } 65 66 67 bool replaceSourcesForFootprints = false; 66 68 if (firstPass) { 67 69 pass = 1; … … 70 72 } else { 71 73 pass = 2; 74 replaceSourcesForFootprints = footprintUseUnsubtracted; 72 75 NSIGMA_PEAK = psMetadataLookupF32 (&status, recipe, "PEAKS_NSIGMA_LIMIT_2"); PS_ASSERT (status, NULL); 73 76 NMAX = 0; // unlimited number of peaks in final pass: allow a limit (PEAKS_NMAX_2) ? … … 96 99 97 100 // detect the peaks in the significance image 98 detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX); 101 int totalPeaks = 0; 102 detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX, &totalPeaks); 99 103 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold); 100 104 if (!detections->peaks) { … … 105 109 return false; 106 110 } 111 // hard limit on number of peaks we will accept. (To avoid memory overload in psphotStack) 112 int maxPeaks = psMetadataLookupS32 (&status, recipe, "PEAKS_NMAX_TOTAL"); PS_ASSERT (status, NULL); 113 if (maxPeaks && (totalPeaks > maxPeaks)) { 114 psFree (detections); 115 psError (PSPHOT_ERR_DATA, true, "Too many peaks %d found PEAKS_NMAX_TOTAL: %d", totalPeaks, maxPeaks); 116 return false; 117 } 107 118 108 119 // optionally merge peaks into footprints 109 120 if (useFootprints) { 121 if (replaceSourcesForFootprints) { 122 psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false); 123 psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false); 124 psFree (significance); 125 significance = psphotSignificanceImage (readout, recipe, maskVal); 126 } 127 110 128 psphotFindFootprints (detections, significance, readout, recipe, threshold, pass, maskVal); 129 130 if (replaceSourcesForFootprints) { 131 psphotRemoveAllSourcesReadout (config, view, filerule, index, recipe, false); 132 } 111 133 } 112 134
Note:
See TracChangeset
for help on using the changeset viewer.
