IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34769 for trunk/psphot/src


Ignore:
Timestamp:
Dec 5, 2012, 3:52:34 PM (14 years ago)
Author:
watersc1
Message:

Implementation of Peter's moments ratio extendedness check. Off by default, but enabled along with other extended threshold changes in the DIFF psphot recipe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotSourceSize.c

    r34418 r34769  
    1111    float nSigmaMoments;
    1212    float nSigmaCR;
     13    bool altDiffExt;
     14    float altDiffExtThresh;
    1315    float soft;
    1416    int grow;
     
    120122    assert (status);
    121123
     124    // Optional extended source measurement algorithm to improve diff image trails
     125    options.altDiffExt = psMetadataLookupBool(&status, recipe, "PSPHOT.EXT.DIFF.ALTERNATE");
     126    assert (status);
     127    // Threshold for this alternate method
     128    options.altDiffExtThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.DIFF.ALTERNATE.THRESH");
     129    assert (status);
     130   
    122131    // location of a single test source
    123132    options.xtest = psMetadataLookupS32 (&status, recipe, "PSPHOT.CRMASK.XTEST");
     
    601610            continue;
    602611        }
    603 
     612        // Alternate extended source limit calculation
     613        if (options->altDiffExt) {
     614          // ratio of major to minor axes
     615          // MRV = Major / Minor
     616          // MRV = (0.5 * (Mxx + Myy) + 0.5 * sqrt( (Mxx + Myy)^2 + 4 Mxy^2)) /
     617          //       (0.5 * (Mxx + Myy) - 0.5 * sqrt( (Mxx + Myy)^2 + 4 Mxy^2))
     618          // MRV = (2 * 0.5 * (Mxx + Myy) - Minor) / Minor
     619          float momentRatioVeres = (Mxx + Myy - Mminor) / Mminor;
     620          bool  isAltEXT = (momentRatioVeres > options->altDiffExtThresh);
     621          if (isAltEXT) {
     622            psTrace("psphotSourceClassRegion.EXT",4,"CLASS: %g %g\t%g %g\t%g %g\t%g %g\t%g ALTEXT\t%g %g\n",
     623                    source->peak->xf, source->peak->yf, Mminor, kMag, dMag, nSigmaMAG, options->sizeLimitCR, options->magLimitCR, options->nSigmaApResid,
     624                    momentRatioVeres,options->altDiffExtThresh);
     625            source->mode |= PM_SOURCE_MODE_EXT_LIMIT;
     626            source->tmpFlags |= PM_SOURCE_TMPF_SIZE_MEASURED;
     627            Next ++;
     628            continue;
     629          }
     630        }
     631       
    604632        // Everything else should just be treated as a PSF
    605633        psTrace("psphotSourceClassRegion.PSF",4,"CLASS: %g %g\t%g %g\t%g %g\t%g %g\t%g PSF\n",
Note: See TracChangeset for help on using the changeset viewer.