IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 15, 2008, 10:25:50 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotParseCamera.c

    r13528 r18555  
    1717    // if MASK or WEIGHT was supplied on command line, bind files to 'load'
    1818    // the mask and weight will be mosaicked with the image
    19     pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.MASK",  "MASK");
     19    pmFPAfile *mask = pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.MASK", "MASK");
    2020    if (!status) {
    2121        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    2222        return NULL;
    2323    }
    24 
     24    if (mask) {
     25        // XXX need to load the mask bit names from one of the headers
     26        // this grabs the first available hdu : no guarantee that it will be valid, though
     27        pmHDU *hdu = pmHDUGetFirst (mask->fpa);
     28        if (!hdu) {
     29            psError(PS_ERR_IO, true, "no valid HDU for PSPHOT.MASK");
     30            return NULL;
     31        }
     32        // XXX should this be done in pmFPAfileIO.c read functions?
     33        if (!pmConfigMaskReadHeader (config, hdu->header)) {
     34            psError(PS_ERR_IO, false, "error in mask bits");
     35            return NULL;
     36        }
     37    }
     38    if (!psphotSetMaskBits (config)) {
     39        psError (PS_ERR_UNKNOWN, false, "failed to set mask bit values");
     40        return NULL;
     41    }
     42   
    2543    pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.WEIGHT", "WEIGHT");
    2644    if (!status) {
Note: See TracChangeset for help on using the changeset viewer.