IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 14, 2008, 2:44:27 PM (18 years ago)
Author:
eugene
Message:

rework to use new masking bit names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080706/pswarp/src/pswarpPixelFraction.c

    r17780 r18513  
    2828    PS_ASSERT_METADATA_NON_NULL(config->arguments, false);
    2929
     30    bool status;
     31
    3032    float minFrac = psMetadataLookupF32(NULL, config->arguments, "ACCEPT.FRAC"); // Minimum fraction
    31     psMaskType maskPoor = psMetadataLookupU8(NULL, config->arguments, "MASK.POOR"); // Mask for "poor" data
    32     psMaskType maskBad = psMetadataLookupU8(NULL, config->arguments, "MASK.BAD"); // Mask for bad data
    33     psMaskType maskVal = maskPoor | maskBad; // Mask to apply
     33
     34    // load the recipe
     35    psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSWARP_RECIPE);
     36    if (!recipe) {
     37        psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);
     38        return false;
     39    }
     40
     41    // output mask bits
     42    psMaskType maskValue = psMetadataLookupU8(&status, recipe, "MASK.OUTPUT");
     43    psAssert (status, "MASK.OUTPUT was not defined");
    3444
    3545    psImage *image = readout->image;    // Image of interest
     
    4555    for (int y = 0; y < numRows; y++) {
    4656        for (int x = 0; x < numCols; x++) {
    47             if (mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal) {
     57            if (mask->data.PS_TYPE_MASK_DATA[y][x] & maskValue) {
    4858                numBad++;
    4959            } else {
Note: See TracChangeset for help on using the changeset viewer.