IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 22, 2008, 2:05:48 PM (18 years ago)
Author:
Paul Price
Message:

Fixing mask values: making a bit more flexible, updating to new pmSubtractionMatch API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackReadout.c

    r18918 r19172  
    1010#include "ppStack.h"
    1111
    12 //#define REJECTION_FILES                 // Write rejection mask?
    13 //#define INSPECTION_FILES                // Write inspection mask?
    14 //#define COMBINED_FILES                  // Write combined images?
     12#define REJECTION_FILES                 // Write rejection mask?
     13#define INSPECTION_FILES                // Write inspection mask?
     14#define COMBINED_FILES                  // Write combined images?
    1515
    1616
     
    3434    int iter = psMetadataLookupS32(NULL, recipe, "ITER"); // Rejection iterations
    3535    float combineRej = psMetadataLookupF32(NULL, recipe, "COMBINE.REJ"); // Combination threshold
    36     psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask
    3736    bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
    3837    bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
     
    4039    psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
    4140    int kernelSize = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size
     41
     42    psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in
     43    psMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch
     44    psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad
     45    psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    4246
    4347    int num = readouts->n;              // Number of inputs
     
    6771    }
    6872
    69     if (!pmStackCombine(outRO, stack, maskVal, maskVal, kernelSize, iter, combineRej, true,
     73    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, kernelSize, iter, combineRej, true,
    7074                        useVariance, safe)) {
    7175        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection.");
     
    9397                                            psRegionSet(0, outRO->image->numCols - 1,
    9498                                                        0, outRO->image->numRows - 1),
    95                                             maskVal);
     99                                            maskBad);
    96100        psString name = NULL;           // Name of image
    97101        psStringAppend(&name, "inspect_%03d_%03d.fits", sectionNum, i);
     
    143147
    144148    bool mdok;                          // Status of MD lookup
    145     psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask
    146149    bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
     150
     151    psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in
     152    psMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch
     153    psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad
     154    psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    147155
    148156    int num = readouts->n;              // Number of inputs
     
    210218                                             psRegionSet(0, outRO->image->numCols - 1,
    211219                                                         0, outRO->image->numRows - 1),
    212                                              maskVal);
     220                                             maskBad);
    213221            psString name = NULL;           // Name of image
    214222            psStringAppend(&name, "reject_%03d.fits", i);
     
    222230#endif
    223231
    224     if (!pmStackCombine(outRO, stack, maskVal, maskVal, 0, 0, NAN, numGood != num, useVariance, false)) {
     232    if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, 0, 0, NAN,
     233                        numGood != num, useVariance, false)) {
    225234        psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts.");
    226235        psFree(fpaList);
Note: See TracChangeset for help on using the changeset viewer.