IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35038 for trunk


Ignore:
Timestamp:
Jan 23, 2013, 3:08:32 PM (14 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.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippconfig/gpc1/psphot.config

    r34769 r35038  
    5353  PSPHOT.EXT.DIFF.ALTERNATE         BOOL TRUE
    5454  PSPHOT.EXT.DIFF.ALTERNATE.THRESH  F32  1.25
     55
     56  PSPHOT.EXT.FIT.ALL.SOURCES        BOOL TRUE
     57  PSPHOT.EXT.FIT.ALL.THRESH         F32  1000
    5558END
    5659
     
    5962  PSPHOT.EXT.DIFF.ALTERNATE         BOOL TRUE
    6063  PSPHOT.EXT.DIFF.ALTERNATE.THRESH  F32  1.25
     64
     65  PSPHOT.EXT.FIT.ALL.SOURCES        BOOL TRUE
     66  PSPHOT.EXT.FIT.ALL.THRESH         F32  1000
    6167END
    6268
  • trunk/ippconfig/recipes/psphot.config

    r34846 r35038  
    347347PSPHOT.EXT.DIFF.ALTERNATE           BOOL  FALSE           # use alternate extended source calculation; designed for diff trails
    348348PSPHOT.EXT.DIFF.ALTERNATE.THRESH    F32   1.5             # threshold for alternate extended source calculations
     349PSPHOT.EXT.FIT.ALL.SOURCES          BOOL  FALSE           # Apply extended object fits to all sources
     350PSPHOT.EXT.FIT.ALL.THRESH           F32   1000            # Set density threshold above which to not fit all sources
    349351PSPHOT.CR.GROW                      S32   1               # Number of pixels to grow CR mask
    350352PSPHOT.CR.NSIGMA.SOFTEN             F32   0.0025          # Softening parameter for weights
  • trunk/psModules/src/camera/pmFPAMaskWeight.c

    r31451 r35038  
    538538    psF32 **imageData = readout->image->data.F32;// Dereference image
    539539    psF32 **varianceData = readout->variance ? readout->variance->data.F32 : NULL; // Dereference variance map
    540 
     540    float maskFrac = 0.0;
    541541    for (int y = 0; y < numRows; y++) {
    542542        for (int x = 0; x < numCols; x++) {
    543543            if (maskData[y][x] & maskVal) {
     544                maskFrac += 1;
    544545                imageData[y][x] = NAN;
    545546                if (varianceData) {
     
    549550        }
    550551    }
    551 
     552    maskFrac = maskFrac / (1.0 * numRows * numCols);
     553    psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "READOUT.MASK.FRAC", PS_META_REPLACE,
     554                     "fraction of pixels masked by pmReadoutMaskApply",maskFrac);
    552555    return true;
    553556}
  • trunk/psModules/src/objects/pmSourceIO_CMF.c.in

    r34564 r35038  
    830830            psMetadataAddF32 (row, PS_LIST_TAIL, "KRON_MAG",         0, "Kron Mag",                                   kronMag);
    831831
    832             @PS1_DV1,PS1_DV2@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS",          0, "number of model parameters",                 model->params->n);
     832            @PS1_DV0,PS1_DV1@ psMetadataAddF32 (row, PS_LIST_TAIL, "NPARAMS",          0, "number of model parameters",                 model->params->n);
    833833            @ALL,!PS1_DV0,!PS1_DV1@ psMetadataAddS32 (row, PS_LIST_TAIL, "NPARAMS",          0, "number of model parameters",                 model->params->n);
    834834            psMetadataAddStr (row, PS_LIST_TAIL, "MODEL_TYPE",       0, "name of model",                              pmModelClassGetName (model->type));
  • 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.