IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 14, 2011, 3:07:22 PM (15 years ago)
Author:
eugene
Message:

psphotSignificanceImage now returns a pmReadout so we can keep the smoothed signal image as well as the S/N image; psphotCullPeaks (and pmFootprintCullPeaks) now uses the smooted image to cull the peaks -- this deals better with low-significance detections are large, low-surface brightness areas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psphot/src/psphotCullPeaks.c

    r30869 r30903  
    66psErrorCode
    77psphotCullPeaks(const pmReadout *readout,   // the image wherein lives the footprint
     8                const pmReadout *signifR, // smoothed image and significance
    89                const psMetadata *recipe,
    910                psArray *footprints) {  // array of pmFootprints
     
    2627    psAssert (status, "cannot find SKY_STDEV in readout->analysis");
    2728
    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);
    2934   
    3035    // for saturated stars, we should be somewhat more agressive about culling: instead of
     
    3641    // fStdev = 0.005, stdev_pad = 0.011*40k = 400
    3742    // 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)
    4046
    4147    float SATURATION = NAN;
     
    7278        }
    7379
    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) {
    7583            return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);
    7684        }
     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
    7797        float dtime = psTimerMark ("psphot.cull.footprints");
    7898        if (dtime > 1.0) {
Note: See TracChangeset for help on using the changeset viewer.