IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35038 for trunk/psphot/src


Ignore:
Timestamp:
Jan 23, 2013, 3:08:32 PM (13 years ago)
Author:
watersc1
Message:

Add READOUT.MASK.FRAC analysis metadata element calculation to pmReadoutMaskApply. Fix typo in pmSourceIO_CMF that doubly defined NPARAMS for DV3. Add configuration/psphotSourceSize parameters to force extended object fits to all sources.

File:
1 edited

Legend:

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

    r34769 r35038  
    1313    bool altDiffExt;
    1414    float altDiffExtThresh;
     15    bool extFitAll;
     16    bool extFitAllReadout;
     17    float extFitAllThresh;
    1518    float soft;
    1619    int grow;
     
    127130    // Threshold for this alternate method
    128131    options.altDiffExtThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.DIFF.ALTERNATE.THRESH");
     132    assert (status);
     133    // Option to enable fitting of all objects with extended model.
     134    options.extFitAll = psMetadataLookupBool(&status, recipe, "PSPHOT.EXT.FIT.ALL.SOURCES");
     135    assert (status);
     136    // Fitting everything is fine, but if the source density is high, we probably shouldn't.
     137    options.extFitAllThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.FIT.ALL.THRESH");
    129138    assert (status);
    130139   
     
    413422
    414423    psLogMsg("psModules.objects", PS_LOG_INFO, "Source Size classifications: %4s %4s %4s %4s %4s", "Npsf", "Next", "Nsat", "Ncr", "Nskip");
    415 
     424    // Determine if this readout is above the threshold to ext fit all sources
     425    if (options->extFitAll) {
     426      float maskFrac = psMetadataLookupF32(&status,readout->analysis,"READOUT.MASK.FRAC");
     427      if (status) {
     428        maskFrac = 0.0;
     429      }
     430      if (sources->n * (1.0 - maskFrac) > options->extFitAllThresh) {
     431        options->extFitAllReadout = false;
     432      }
     433      else {
     434        options->extFitAllReadout = true;
     435      }
     436    }
     437   
    416438    if (!psphotSourceClassRegion (NULL, &psfClump, sources, recipe, psf, options)) {
    417439        psLogMsg ("psphot", 4, "Failed to determine source classification for full image\n");
     
    420442    }
    421443    return true;
    422 
     444   
    423445    int nRegions = psMetadataLookupS32 (&status, readout->analysis, "PSF.CLUMP.NREGIONS");
    424446    for (int i = 0; i < nRegions; i ++) {
     
    426448        psMetadata *regionMD = psMetadataLookupPtr (&status, readout->analysis, regionName);
    427449        psAssert (regionMD, "regions must be defined by earlier call to psphotRoughClassRegion");
    428 
     450       
    429451        psRegion *region = psMetadataLookupPtr (&status, regionMD, "REGION");
    430452        psAssert (region, "regions must be defined by earlier call to psphotRoughClassRegion");
    431 
     453       
    432454        // pull FWHM_X,Y from the recipe, use to define psfClump.X,Y
    433455        psfClump.X  = psMetadataLookupF32 (&status, regionMD, "PSF.CLUMP.X");   psAssert (status, "missing PSF.CLUMP.X");
     
    559581        // * SAT stars should not be faint, but defects may?
    560582
     583        // If the recipe requests we do extended source fits to everything, set
     584        // the EXT_LIMIT flag
     585        if (options->extFitAllReadout) {
     586          source->mode |= PM_SOURCE_MODE_EXT_LIMIT;
     587        }
    561588        // Defects may not always match CRs from peak curvature analysis
    562589        // Defects may also be marked as SATSTAR -- XXX deactivate this flag?
Note: See TracChangeset for help on using the changeset viewer.