Changeset 20995 for trunk/ppStack/src/ppStackCamera.c
- Timestamp:
- Dec 15, 2008, 1:18:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackCamera.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackCamera.c
r20710 r20995 73 73 bool haveWeights = false; // Do we have weight maps? 74 74 bool havePSFs = false; // Do we have PSFs? 75 bool haveSources = (bool)psMetadataLookup(config->arguments, "PPSTACK.SOURCES"); // Have global sources?76 75 77 76 psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info … … 195 194 196 195 // Add the sources file 197 if (!haveSources) { 198 if (!sources || strlen(sources) == 0) { 199 if (havePSFs) { 200 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find SOURCES %d", i); 201 return false; 202 } 203 } else { 204 if (!havePSFs) { 205 psWarning("SOURCES provided without PSF --- ignoring."); 206 } else { 207 psArray *sourcesFiles = psArrayAlloc(1); // Array of filenames for this FPA 208 sourcesFiles->data[0] = psMemIncrRefCounter(sources); 209 psMetadataAddArray(config->arguments, PS_LIST_TAIL, "SOURCES.FILENAMES", PS_META_REPLACE, 210 "Filenames of SOURCES files", sourcesFiles); 211 psFree(sourcesFiles); 212 213 bool status; 214 pmFPAfile *sourcesFile = pmFPAfileBindFromArgs(&status, imageFile, config, 215 "PPSTACK.INPUT.SOURCES", 216 "SOURCES.FILENAMES"); 217 if (!status) { 218 psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)", 219 i, sources); 220 return false; 221 } 222 if (sourcesFile->type != PM_FPA_FILE_CMF) { 223 psError(PS_ERR_IO, true, "PPSTACK.INPUT.SOURCES is not of type CMF"); 224 return false; 225 } 226 } 196 { 197 psArray *sourcesFiles = psArrayAlloc(1); // Array of filenames for this FPA 198 sourcesFiles->data[0] = psMemIncrRefCounter(sources); 199 psMetadataAddArray(config->arguments, PS_LIST_TAIL, "SOURCES.FILENAMES", PS_META_REPLACE, 200 "Filenames of SOURCES files", sourcesFiles); 201 psFree(sourcesFiles); 202 203 bool status; 204 pmFPAfile *sourcesFile = pmFPAfileBindFromArgs(&status, imageFile, config, 205 "PPSTACK.INPUT.SOURCES", "SOURCES.FILENAMES"); 206 if (!status) { 207 psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)", 208 i, sources); 209 return false; 210 } 211 if (sourcesFile->type != PM_FPA_FILE_CMF) { 212 psError(PS_ERR_IO, true, "PPSTACK.INPUT.SOURCES is not of type CMF"); 213 return false; 227 214 } 228 215 } … … 269 256 } 270 257 271 if (haveSources) {272 // Global list of sources for use as stamps273 bool status = false; // Found the file?274 if (havePSFs) {275 pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSTACK.INPUT.SOURCES",276 "PPSTACK.SOURCES");277 if (!status) {278 psError(PS_ERR_IO, false, "Failed to load file definition PPSTACK.INPUT.SOURCES");279 return false;280 }281 if (sources && sources->type != PM_FPA_FILE_CMF) {282 psError(PS_ERR_IO, true, "PPSTACK.SOURCES is not of type CMF");283 return false;284 }285 }286 }287 288 258 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", i); 289 259 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.PSF", 0, "Have PSFs available?", havePSFs); 290 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.SOURCES", 0, "Have global sources?",291 haveSources);292 260 293 261 // Output image
Note:
See TracChangeset
for help on using the changeset viewer.
