- Timestamp:
- Mar 14, 2011, 3:07:22 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psphot/src/psphotCullPeaks.c
r30869 r30903 6 6 psErrorCode 7 7 psphotCullPeaks(const pmReadout *readout, // the image wherein lives the footprint 8 const pmReadout *signifR, // smoothed image and significance 8 9 const psMetadata *recipe, 9 10 psArray *footprints) { // array of pmFootprints … … 26 27 psAssert (status, "cannot find SKY_STDEV in readout->analysis"); 27 28 28 const float MIN_THRESHOLD = nsigma_min*skyStdev; 29 // the sky has been smoothed, so we need to scale down the raw sky stdev by this amount: 30 float scaleFactor = psMetadataLookupF32(&status, readout->analysis, "SIGNIFICANCE_SCALE_FACTOR"); 31 if (!status) scaleFactor = 1.0; 32 33 const float MIN_THRESHOLD = nsigma_min*skyStdev / sqrt(scaleFactor); 29 34 30 35 // for saturated stars, we should be somewhat more agressive about culling: instead of … … 36 41 // fStdev = 0.005, stdev_pad = 0.011*40k = 400 37 42 // threshold = 40k - 4*400 = 38400 38 39 // in practice, we should make the threshold in such a case more like 0.5 * saturation... 43 // this gives too tight of a tolerance on the bright stars 44 // in practice, we should make the threshold much lower. 45 // below I am using 0.05 * saturation (eg, 2000 DN above sky in a GPC1 image) 40 46 41 47 float SATURATION = NAN; … … 72 78 } 73 79 74 if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold) != PS_ERR_NONE) { 80 // if we cull using the significance image, then the thresholds are different 81 # if (0) 82 if (pmFootprintCullPeaks(signifR->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) { 75 83 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 76 84 } 85 # endif 86 # if (1) 87 if (pmFootprintCullPeaks(signifR->image, signifR->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, false) != PS_ERR_NONE) { 88 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 89 } 90 # endif 91 # if (0) 92 if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) { 93 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 94 } 95 # endif 96 77 97 float dtime = psTimerMark ("psphot.cull.footprints"); 78 98 if (dtime > 1.0) {
Note:
See TracChangeset
for help on using the changeset viewer.
