- Timestamp:
- Jul 11, 2008, 8:35:04 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080706/ppImage/src/ppImageSetMaskBits.c
r18430 r18472 7 7 bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options) { 8 8 9 // Mask recipe options 10 const char *masks = psMetadataLookupStr(&status, recipe, "MASK.VALUE"); 11 if (status) { 12 options->maskValue = pmConfigMask(masks, config); 9 if (!pmConfigMaskSetBits (&options->maskValue, &options->markValue, config)) { 10 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values"); 11 return false; 13 12 } 14 13 15 darkMask = pmConfigMask("DARK", config); 16 options->flatMask = pmConfigMask("FLAT", config); 17 options->blankMask = pmConfigMask("BLANK", config); 18 detectorMask = pmConfigMask("DETECTOR", config); 14 // at this point we know we have valid values for required entries SAT, BAD, FLAT, BLANK: 19 15 20 options->satMask = pmConfigMask("SAT", config); 21 options->badMask = pmConfigMask("BAD", config); 16 // mask for non-linear flat corrections 17 options->flatMask = pmConfigMaskGet("FLAT", config); 18 psAssert (options->flatMask, "flat mask not set"); 22 19 23 rangeMask = pmConfigMask("RANGE", config); 20 // mask for non-existent data (default to DETECTOR if not defined) 21 options->blankMask = pmConfigMaskGet("BLANK", config); 22 psAssert (options->blankMask, "blank mask not set"); 24 23 25 crMask = pmConfigMask("CR", config); 26 ghostMask = pmConfigMask("GHOST", config); 24 // mask for saturated data (default to RANGE if not defined) 25 options->satMask = pmConfigMaskGet("SAT", config); 26 psAssert (options->satMask, "sat mask not set"); 27 28 // mask for below-range data (default to RANGE if not defined) 29 options->badMask = pmConfigMaskGet("BAD", config); 30 psAssert (options->badMask, "bad mask not set"); 27 31 28 // XXX it should be an error for these to not exist 29 if (!options->flatMask) { 30 psWarning ("FLAT MASK is not set"); 32 // save MASK and MARK on the PSPHOT recipe 33 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE); 34 if (!recipe) { 35 psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE); 36 return false; 31 37 } 32 if (!options->flatMask) { 33 psWarning ("FLAT MASK is not set"); 34 } 38 39 // set maskValue and markValue in the psphot recipe 40 psMetadataAddU8 (recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "user-defined mask", options->maskValue); 41 psMetadataAddU8 (recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "user-defined mask", options->markValue); 35 42 36 43 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
