Changeset 27838 for branches/tap_branches/pswarp/src/pswarpParseCamera.c
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pswarp/src/pswarpParseCamera.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/pswarp/src/pswarpParseCamera.c
r25522 r27838 23 23 bool status; 24 24 25 // look for the file on the RUN metadata 26 pmFPAfile *file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return 25 pmFPAfile *file = NULL; 26 // look for the file on the argument list 27 if (bind) { 28 file = pmFPAfileBindFromArgs(&status, bind, config, filerule, argname); 29 } else { 30 file = pmFPAfileDefineFromArgs(&status, config, filerule, argname); 31 } 27 32 if (!status) { 28 psError( PSWARP_ERR_CONFIG, false, "Failed to load file definition for %s", filerule);29 return NULL;33 psError(psErrorCodeLast(), false, "Failed to load file definition for %s", filerule); 34 return false; 30 35 } 31 36 if (!file) { 32 // look for the file on the argument list 33 if (bind) { 34 file = pmFPAfileBindFromArgs(&status, bind, config, filerule, argname); 35 } else { 36 file = pmFPAfileDefineFromArgs(&status, config, filerule, argname); 37 } 37 // look for the file on the RUN metadata 38 file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return 38 39 if (!status) { 39 psError( PSWARP_ERR_CONFIG, false, "Failed to load file definition for %s", filerule);40 return false;40 psError(psErrorCodeLast(), false, "Failed to load file definition for %s", filerule); 41 return NULL; 41 42 } 42 43 } … … 64 65 pmFPAfile *input = defineInputFile(config, NULL, "PSWARP.INPUT", "INPUT", PM_FPA_FILE_IMAGE); 65 66 if (!input) { 66 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.INPUT");67 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.INPUT"); 67 68 return false; 68 69 } … … 88 89 bool status = pswarpDefineSkycell(&skycell, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL"); 89 90 if (!status) { 90 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.SKYCELL");91 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.SKYCELL"); 91 92 return false; 92 93 } … … 96 97 pmFPAfile *output = pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT"); 97 98 if (!output) { 98 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT");99 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT"); 99 100 return false; 100 101 } … … 103 104 pmFPAfile *outMask = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.MASK"); 104 105 if (!outMask) { 105 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.MASK");106 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.MASK"); 106 107 return false; 107 108 } … … 111 112 pmFPAfile *outVariance = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.VARIANCE"); 112 113 if (!outVariance) { 113 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.VARIANCE");114 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.VARIANCE"); 114 115 return false; 115 116 } … … 120 121 pmFPAfile *outSources = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.SOURCES"); 121 122 if (!outSources) { 122 psError( PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.SOURCES");123 psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.SOURCES"); 123 124 return false; 124 125 } … … 128 129 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSWARP_RECIPE); 129 130 if (!recipe) { 130 psError(PS PHOT_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE);131 psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE); 131 132 return false; 132 133 } … … 138 139 pmFPAfile *psphotInput = pmFPAfileDefineSkycell(config, NULL, "PSPHOT.INPUT"); 139 140 if (!psphotInput) { 140 psError( PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.INPUT"));141 psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT")); 141 142 return false; 142 143 } 143 144 psphotInput->src = psMemIncrRefCounter(output->fpa); 145 // specify the number of psphot input images 146 psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", 1); 144 147 145 148 pmFPAfile *psphotInSources = pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF"); 146 149 if (!psphotInSources) { 147 psError( PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.INPUT.CMF"));150 psError(psErrorCodeLast(), false, _("Unable to generate output file from PSPHOT.INPUT.CMF")); 148 151 return false; 149 152 } … … 152 155 psMetadata *psphotRecipe = psMetadataLookupPtr(NULL, config->recipes, PSPHOT_RECIPE); // Recipe 153 156 if (!psphotRecipe) { 154 psError(PS _ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE);157 psError(PSWARP_ERR_CONFIG, false, "Unable to find %s recipe.", PSPHOT_RECIPE); 155 158 return false; 156 159 } … … 159 162 // Define associated psphot input/output files 160 163 if (!psphotDefineFiles(config, psphotInput)) { 161 psError(PS PHOT_ERR_CONFIG, false,164 psError(PSWARP_ERR_CONFIG, false, 162 165 "Unable to define the additional input/output files for psphot"); 163 166 return false; … … 180 183 int chipNum = atoi(chips->data[i]); 181 184 if (! pmFPASelectChip(input->fpa, chipNum, false)) { 182 psError(PSWARP_ERR_ CONFIG, true, "Chip number %d doesn't exist in camera.\n", chipNum);185 psError(PSWARP_ERR_ARGUMENTS, true, "Chip number %d doesn't exist in camera.\n", chipNum); 183 186 return false; 184 187 }
Note:
See TracChangeset
for help on using the changeset viewer.
