Changeset 19141
- Timestamp:
- Aug 20, 2008, 3:19:59 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotParseCamera.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotParseCamera.c
r18555 r19141 10 10 pmFPAfile *load = pmFPAfileDefineFromArgs (&status, config, "PSPHOT.LOAD", "INPUT"); 11 11 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; 14 14 } 15 15 load->dataLevel = PM_FPA_LEVEL_CHIP; // force load at the CHIP level … … 17 17 // if MASK or WEIGHT was supplied on command line, bind files to 'load' 18 18 // 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"); 20 20 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; 37 23 } 38 24 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; 41 27 } 42 28 43 29 pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.WEIGHT", "WEIGHT"); 44 30 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; 47 33 } 48 34 … … 54 40 } 55 41 56 // define the additional input/output files associated with psphot 42 // define the additional input/output files associated with psphot 57 43 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; 60 46 } 61 47 … … 64 50 psArray *chips = psStringSplitArray (chipLine, ",", false); 65 51 if (chips->n > 0) { 66 // select on the basis of extname?67 pmFPASelectChip (load->fpa, -1, true); // deselect all chips68 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 } 74 60 } 75 61 } … … 77 63 psTrace("psphot", 1, "Done with psphotParseCamera...\n"); 78 64 79 psErrorClear(); // some metadata lookup may have failed65 psErrorClear(); // some metadata lookup may have failed 80 66 return true; 81 67 }
Note:
See TracChangeset
for help on using the changeset viewer.
