IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30902


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

allows the input weight image to pmFootprintCullPeaks.c to be a S/N or normal Variance image (this allows us to use the smoothed significance image in the footprint analysis

Location:
branches/eam_branches/ipp-20110213/psModules/src/objects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprint.h

    r30865 r30902  
    8585                                 const float fPadding, // fractional padding added to stdev since bright peaks have unreasonably high significance
    8686                                 const float min_threshold, // minimum permitted coll height
    87                                  const float max_threshold // maximum permitted coll height
     87                                 const float max_threshold,// maximum permitted coll height
     88                                 const bool isWeightVar // the input weight may be variance (sigma^2) or S/N (1/sigma)
    8889    );
    8990
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmFootprintCullPeaks.c

    r30865 r30902  
    3939                                 const float fPadding, // fractional padding added to stdev since bright peaks have unreasonably high significance
    4040                                 const float min_threshold, // minimum permitted coll height
    41                                  const float max_threshold) { // maximum permitted coll height
     41                                 const float max_threshold,
     42                                 const bool isWeightVar
     43    ) { // maximum permitted coll height
    4244    assert (img != NULL); assert (img->type.type == PS_TYPE_F32);
    4345    assert (weight != NULL); assert (weight->type.type == PS_TYPE_F32);
     
    98100        // float threshold = subImg->data.F32[y][x] - nsigma_delta*stdev;
    99101
    100         const float stdev = sqrt(subWt->data.F32[y][x]);
    101         const float flux = subImg->data.F32[y][x];
    102         const float fStdev = fabs(stdev/flux);
    103         const float stdev_pad = fabs(flux * hypot(fStdev, fPadding));
     102        float stdev = 0.0;
     103        float flux = 0.0;
     104        if (isWeightVar) {
     105            flux = subImg->data.F32[y][x];
     106            stdev = sqrt(subWt->data.F32[y][x]);
     107        } else {
     108            flux = subImg->data.F32[y][x];
     109            stdev = flux / sqrt(subWt->data.F32[y][x]); // should be 1/sqrt(subWT)
     110        }
     111        const float fStdev = fabs(stdev/flux);
     112        const float stdev_pad = fabs(flux * hypot(fStdev, fPadding));
     113
    104114        // if flux is negative, careful with fStdev
    105115
     
    124134        }
    125135
     136        // XXX can we / should we use pmFootprintsFind() if the starting footprint is too large?
    126137        // init peakFootprint here?
    127138        pmFootprintsFindAtPoint(peakFootprint, peakFPSpans, subImg, subMask, threshold, brightPeaks, peak->y, peak->x);
Note: See TracChangeset for help on using the changeset viewer.