IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19141


Ignore:
Timestamp:
Aug 20, 2008, 3:19:59 PM (18 years ago)
Author:
Paul Price
Message:

Loading the mask from the header is done from within the psModules/camera functions.

File:
1 edited

Legend:

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

    r18555 r19141  
    1010    pmFPAfile *load = pmFPAfileDefineFromArgs (&status, config, "PSPHOT.LOAD", "INPUT");
    1111    if (!status) {
    12         psError(PSPHOT_ERR_CONFIG, false, "Failed to build FPA from PSPHOT.LOAD");
    13         return status;
     12        psError(PSPHOT_ERR_CONFIG, false, "Failed to build FPA from PSPHOT.LOAD");
     13        return status;
    1414    }
    1515    load->dataLevel = PM_FPA_LEVEL_CHIP; // force load at the CHIP level
     
    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     pmFPAfile *mask = pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.MASK", "MASK");
     19    pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.MASK", "MASK");
    2020    if (!status) {
    21         psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    22         return NULL;
    23     }
    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         }
     21        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
     22        return NULL;
    3723    }
    3824    if (!psphotSetMaskBits (config)) {
    39         psError (PS_ERR_UNKNOWN, false, "failed to set mask bit values");
    40         return NULL;
     25        psError (PS_ERR_UNKNOWN, false, "failed to set mask bit values");
     26        return NULL;
    4127    }
    42    
     28
    4329    pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.WEIGHT", "WEIGHT");
    4430    if (!status) {
    45         psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    46         return NULL;
     31        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
     32        return NULL;
    4733    }
    4834
     
    5440    }
    5541
    56     // define the additional input/output files associated with psphot 
     42    // define the additional input/output files associated with psphot
    5743    if (!psphotDefineFiles (config, input)) {
    58         psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files");
    59         return false;
     44        psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files");
     45        return false;
    6046    }
    6147
     
    6450    psArray *chips = psStringSplitArray (chipLine, ",", false);
    6551    if (chips->n > 0) {
    66         // select on the basis of extname?
    67         pmFPASelectChip (load->fpa, -1, true); // deselect all chips
    68         for (int i = 0; i < chips->n; i++) {
    69             int chipNum = atoi(chips->data[i]);
    70             if (! pmFPASelectChip(load->fpa, chipNum, false)) {
    71                 psError(PSPHOT_ERR_CONFIG, false, "Chip number %d doesn't exist in camera.\n", chipNum);
    72                 return false;
    73             }
     52        // select on the basis of extname?
     53        pmFPASelectChip (load->fpa, -1, true); // deselect all chips
     54        for (int i = 0; i < chips->n; i++) {
     55            int chipNum = atoi(chips->data[i]);
     56            if (! pmFPASelectChip(load->fpa, chipNum, false)) {
     57                psError(PSPHOT_ERR_CONFIG, false, "Chip number %d doesn't exist in camera.\n", chipNum);
     58                return false;
     59            }
    7460        }
    7561    }
     
    7763    psTrace("psphot", 1, "Done with psphotParseCamera...\n");
    7864
    79     psErrorClear();                     // some metadata lookup may have failed
     65    psErrorClear();                     // some metadata lookup may have failed
    8066    return true;
    8167}
Note: See TracChangeset for help on using the changeset viewer.