IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 23, 2020, 3:29:09 PM (6 years ago)
Author:
tdeboer
Message:

added procedure to remove pixel NaNing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubBackground.c

    r29937 r41382  
    3333    psAssert(psphotRecipe, "Need PSPHOT recipe for binning");
    3434
     35    bool doApplyMaskNaN = psMetadataLookupBool(&mdok, ppSubRecipe, "APPLY.PIXELNAN"); // NaN the pixels underneath masks
     36
    3537    psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask
    3638
     
    6466        for (int x = 0; x < numCols; x++) {
    6567            // special case 1: NAN the masked pixels
    66             if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskBad) {
     68            if(doApplyMaskNaN) {
     69              if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskBad) {
    6770                image->data.F32[y][x] = NAN;
    6871                continue;
    69             }
    70             // special case 1: NAN & mask pixels without a valid background model
     72              }
     73            }
     74            // special case 2: NAN & mask pixels without a valid background model
    7175            float value = psImageUnbinPixel(x + 0.5, y + 0.5, modelImage, binning); // Background value
    7276            if (!isfinite(value)) {
Note: See TracChangeset for help on using the changeset viewer.