IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 6, 2012, 6:32:19 PM (14 years ago)
Author:
watersc1
Message:

merge from trunk. Preliminary versions of stacktool/warptool updates and regenerate_background.pl script. The warp code is finished and tested, and I still need to get the stack version resolved.

Location:
branches/czw_branch/20120906/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/psphot

  • branches/czw_branch/20120906/psphot/src

  • branches/czw_branch/20120906/psphot/src/psphotFindDetections.c

    r34404 r34772  
    4646    psAssert (maskVal, "missing mask value?");
    4747
     48    // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
     49    psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT"); // Mask value for bad pixels
     50    psAssert (markVal, "missing mark value?");
     51
     52    maskVal |= markVal;
     53
    4854    // Use the new pmFootprints approach?
    4955    const bool useFootprints = psMetadataLookupBool(NULL, recipe, "USE_FOOTPRINTS");
     
    6470        psMemIncrRefCounter(detections); // so we can free the detections below
    6571    }
     72
     73    // first pass vs other: if this is the first pass, the code will use PEAKS_NSIGMA_LIMIT and
     74    // only attempt to detect PEAKS_NMAX entries.  If 'firstPass' is false, the code will
     75    // attempt to replace the subtracted sources in order to measure the footprints.  After
     76    // replacement, it is necessary to regenerate the significance image.  If no sources are
     77    // available, the code will skip the significance image regeneration step.
    6678
    6779    bool replaceSourcesForFootprints = false;
     
    120132    if (useFootprints) {
    121133        if (replaceSourcesForFootprints) {
     134            bool modified = false;
    122135            // subtract the noise for all sources including satstars
    123             psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false);
    124             psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false);
     136            modified |= psphotAddOrSubNoiseReadout(config, view, filerule, index, recipe, false);
     137            modified |= psphotReplaceAllSourcesReadout (config, view, filerule, index, recipe, false);
    125138
    126139            // add in the satstars
    127             psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, true);
     140            modified |= psphotAddOrSubSatstarsReadout (config, view, filerule, index, recipe, true);
    128141
    129             psFree (significance);
    130             significance = psphotSignificanceImage (readout, recipe, maskVal);
     142            if (modified) {
     143                psFree (significance);
     144                significance = psphotSignificanceImage (readout, recipe, maskVal);
     145            }
    131146
    132147            // display the significance image
Note: See TracChangeset for help on using the changeset viewer.