IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 15, 2008, 10:26:37 AM (18 years ago)
Author:
eugene
Message:

re-org and cleanup of the mask bits to make it consistent with the pmConfigMaskSetBits concepts; ensure mark and mask are correctly used and supplied to psphot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageParseCamera.c

    r18422 r18556  
    2020    }
    2121
    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'.
    2323    // the mask and weight will be mosaicked with the image
    2424    pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.MASK", "PPIMAGE.INPUT.MASK");
     
    2727        return NULL;
    2828    }
    29     if (inputMask && inputMask->type != PM_FPA_FILE_MASK) {
     29    if (inputMask) {
     30      if (inputMask->type != PM_FPA_FILE_MASK) {
    3031        psError(PS_ERR_IO, true, "PPIMAGE.INPUT.MASK is not of type MASK");
    3132        return NULL;
     33      }
    3234    }
    3335
     
    6668    }
    6769    if (options->doMask) {
     70
    6871        if (!ppImageDefineFile (config, input->fpa, "PPIMAGE.MASK", "MASK", PM_FPA_FILE_MASK, PM_DETREND_TYPE_MASK)) {
    6972            psError (PS_ERR_IO, false, "Can't find a mask image source");
     
    7174            return NULL;
    7275        }
    73         // Need to read the names of bit masks from the mask header and set them in the recipe
     76        // XXX have ppImageDefineFile return the pmFPAfile?
     77        pmFPAfile *mask = psMetadataLookupPtr(&status, config->files, "PPIMAGE.MASK");
     78        psAssert (mask, "mask not defined?  not possible!");
     79
     80        // Need to read the names of bit masks from the mask header and set them in the
     81        // recipe.  If we are loading this from the detrend db, this action will happen
     82        // when the file is resolved.
     83        if (!mask->detrend) {
     84            // XXX need to load the mask bit names from one of the headers
     85            // this grabs the first available hdu : no guarantee that it will be valid, though
     86            pmHDU *hdu = pmHDUGetFirst (mask->fpa);
     87            if (!hdu) {
     88                psError(PS_ERR_IO, true, "no valid HDU for PPIMAGE.INPUT.MASK");
     89                return NULL;
     90            }
     91            // XXX is this consistent with the pmConfigMaskReadHeader call above?
     92            if (!pmConfigMaskReadHeader (config, hdu->header)) {
     93                psError(PS_ERR_IO, false, "error in mask bits");
     94                return NULL;
     95            }
     96        }
    7497    }
    7598    if (options->doShutter) {
Note: See TracChangeset for help on using the changeset viewer.