Changeset 12771 for trunk/pswarp/src/pswarpParseCamera.c
- Timestamp:
- Apr 5, 2007, 5:38:16 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpParseCamera.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpParseCamera.c
r12526 r12771 11 11 pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PSWARP.INPUT", "INPUT"); 12 12 if (!input) { 13 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.INPUT");14 return false;13 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.INPUT"); 14 return false; 15 15 } 16 16 … … 19 19 pmFPAfileDefineFromArgs (&status, config, "PSWARP.ASTROM", "ASTROM"); 20 20 if (status) { 21 psLogMsg ("pswarp", 3, "using supplied astrometry\n");21 psLogMsg ("pswarp", 3, "using supplied astrometry\n"); 22 22 } else { 23 psLogMsg ("pswarp", 3, "using header astrometry\n");23 psLogMsg ("pswarp", 3, "using header astrometry\n"); 24 24 } 25 25 26 26 // the mask is not required - but must conform to input camera 27 if (!pmFPAfileBindFromArgs (NULL, input, config, "PSWARP.MASK", "MASK")) { 28 psLogMsg ("pswarp", 3, "no mask supplied\n"); 29 } 27 pmFPAfile *inMask = pmFPAfileBindFromArgs(NULL, input, config, "PSWARP.MASK", "MASK"); 28 if (!inMask) { 29 psLogMsg ("pswarp", 3, "no mask supplied\n"); 30 } 30 31 31 if (!pmFPAfileBindFromArgs (NULL, input, config, "PSWARP.WEIGHT", "WEIGHT")) { 32 psLogMsg ("pswarp", 3, "no weight supplied\n"); 33 } 32 pmFPAfile *inWeight = pmFPAfileBindFromArgs(NULL, input, config, "PSWARP.WEIGHT", "WEIGHT"); 33 if (!inWeight) { 34 psLogMsg ("pswarp", 3, "no weight supplied\n"); 35 } 34 36 35 37 // the input skycell is a required argument: it defines the output image … … 37 39 status = pswarpDefineSkycell (&skycell, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL"); 38 40 if (!status) { 39 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.SKYCELL");40 return false;41 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.SKYCELL"); 42 return false; 41 43 } 42 44 … … 45 47 // if (!pmFPAfileDefineFromFPA (skyConfig, skycell->fpa, 1, 1, "PSWARP.OUTPUT")) { 46 48 if (!pmFPAfileDefineOutput (skyConfig, skycell->fpa, "PSWARP.OUTPUT")) { 47 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT"); 48 return false; 49 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT"); 50 return false; 51 } 52 if (inMask) { 53 if (!pmFPAfileDefineOutput (skyConfig, skycell->fpa, "PSWARP.OUTPUT.MASK")) { 54 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.MASK"); 55 return false; 56 } 57 } 58 if (inWeight) { 59 if (!pmFPAfileDefineOutput (skyConfig, skycell->fpa, "PSWARP.OUTPUT.WEIGHT")) { 60 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.WEIGHT"); 61 return false; 62 } 49 63 } 50 64 51 65 // Chip selection: turn on only the chips specified 52 char *chipLine = psMetadataLookupStr(NULL, config->arguments, "CHIP_SELECTIONS"); 66 char *chipLine = psMetadataLookupStr(NULL, config->arguments, "CHIP_SELECTIONS"); 53 67 psArray *chips = psStringSplitArray (chipLine, ",", false); 54 68 if (chips->n > 0) { 55 pmFPASelectChip (input->fpa, -1, true); // deselect all chips56 for (int i = 0; i < chips->n; i++) {57 int chipNum = atoi(chips->data[i]);58 if (! pmFPASelectChip(input->fpa, chipNum, false)) {59 psError(PSWARP_ERR_CONFIG, true, "Chip number %d doesn't exist in camera.\n", chipNum);60 return false;61 }69 pmFPASelectChip (input->fpa, -1, true); // deselect all chips 70 for (int i = 0; i < chips->n; i++) { 71 int chipNum = atoi(chips->data[i]); 72 if (! pmFPASelectChip(input->fpa, chipNum, false)) { 73 psError(PSWARP_ERR_CONFIG, true, "Chip number %d doesn't exist in camera.\n", chipNum); 74 return false; 75 } 62 76 } 63 77 }
Note:
See TracChangeset
for help on using the changeset viewer.
