- Timestamp:
- Jul 6, 2008, 6:23:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080706/ppImage/src/ppImageParseCamera.c
r18422 r18430 20 20 } 21 21 22 // if MASK or WEIGHT was supplied on command line, bind files to 'input' 22 // if MASK or WEIGHT was supplied on command line, bind files to 'input'. 23 23 // the mask and weight will be mosaicked with the image 24 24 pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.MASK", "PPIMAGE.INPUT.MASK"); … … 27 27 return NULL; 28 28 } 29 if (inputMask && inputMask->type != PM_FPA_FILE_MASK) { 29 if (inputMask) { 30 if (inputMask->type != PM_FPA_FILE_MASK) { 30 31 psError(PS_ERR_IO, true, "PPIMAGE.INPUT.MASK is not of type MASK"); 31 32 return NULL; 33 } 34 // XXX need to load the mask bit names from one of the headers 35 // this grabs the first available hdu : no guarantee that it will be valid, though 36 pmHDU *hdu = pmHDUGetFirst (inputMask->fpa); 37 if (!hdu) { 38 psError(PS_ERR_IO, true, "no valid HDU for PPIMAGE.INPUT.MASK"); 39 return NULL; 40 } 41 if (!pmConfigMaskReadHeader (config, hdu->header)) { 42 psError(PS_ERR_IO, false, "error in mask bits"); 43 return NULL; 44 } 32 45 } 33 46 … … 66 79 } 67 80 if (options->doMask) { 81 68 82 if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.MASK", "MASK", PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) { 69 83 psError (PS_ERR_IO, false, "Can't find a mask image source"); … … 71 85 return NULL; 72 86 } 73 // Need to read the names of bit masks from the mask header and set them in the recipe 87 // XXX have ppImageDefineFile return the pmFPAfile? 88 pmFPAfile *mask = psMetadataLookupPtr(&status, config->files, "PPIMAGE.MASK"); 89 psAssert (mask, "mask not defined? not possible!"); 90 91 // Need to read the names of bit masks from the mask header and set them in the 92 // recipe. If we are loading this from the detrend db, this action will happen 93 // when the file is resolved. 94 if (!mask->detrend) { 95 // XXX need to load the mask bit names from one of the headers 96 // this grabs the first available hdu : no guarantee that it will be valid, though 97 pmHDU *hdu = pmHDUGetFirst (mask->fpa); 98 if (!hdu) { 99 psError(PS_ERR_IO, true, "no valid HDU for PPIMAGE.INPUT.MASK"); 100 return NULL; 101 } 102 // XXX is this consistent with the pmConfigMaskReadHeader call above? 103 if (!pmConfigMaskReadHeader (config, hdu->header)) { 104 psError(PS_ERR_IO, false, "error in mask bits"); 105 return NULL; 106 } 107 } 74 108 } 75 109 if (options->doShutter) {
Note:
See TracChangeset
for help on using the changeset viewer.
