Changeset 18346 for trunk/ppStack/src/ppStackCamera.c
- Timestamp:
- Jun 27, 2008, 12:05:30 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackCamera.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackCamera.c
r17916 r18346 72 72 { 73 73 bool haveWeights = false; // Do we have weight maps? 74 bool havePSFs = false; // Do we have PSFs? 74 bool havePSFs = false; // Do we have PSFs? 75 bool haveSources = (bool)psMetadataLookup(config->arguments, "PPSTACK.SOURCES"); // Have global sources? 75 76 76 77 psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info … … 99 100 psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weight map 100 101 psString psf = psMetadataLookupStr(&mdok, input, "PSF"); // Name of PSF 102 psString sources = psMetadataLookupStr(&mdok, input, "SOURCES"); // Name of sources 101 103 102 104 float weighting = psMetadataLookupF32(&mdok, input, "WEIGHTING"); // Relative weighting … … 198 200 } 199 201 202 // Add the sources file 203 if (!haveSources) { 204 if (!sources || strlen(sources) == 0) { 205 if (havePSFs) { 206 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find SOURCES %d", i); 207 return false; 208 } 209 } else { 210 if (!havePSFs) { 211 psWarning("SOURCES provided without PSF --- ignoring."); 212 } else { 213 psArray *sourcesFiles = psArrayAlloc(1); // Array of filenames for this FPA 214 sourcesFiles->data[0] = psMemIncrRefCounter(sources); 215 psMetadataAddArray(config->arguments, PS_LIST_TAIL, "SOURCES.FILENAMES", PS_META_REPLACE, 216 "Filenames of SOURCES files", sourcesFiles); 217 psFree(sourcesFiles); 218 219 bool status; 220 pmFPAfile *sourcesFile = pmFPAfileBindFromArgs(&status, imageFile, config, 221 "PPSTACK.INPUT.SOURCES", 222 "SOURCES.FILENAMES"); 223 if (!status) { 224 psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)", 225 i, sources); 226 return false; 227 } 228 if (sourcesFile->type != PM_FPA_FILE_CMF) { 229 psError(PS_ERR_IO, true, "PPSTACK.INPUT.SOURCES is not of type CMF"); 230 return false; 231 } 232 } 233 } 234 } 235 200 236 #if 0 201 237 // Output convolved files … … 238 274 psMetadataRemoveKey(config->arguments, "PSF.FILENAMES"); 239 275 } 276 if (psMetadataLookup(config->arguments, "SOURCES.FILENAMES")) { 277 psMetadataRemoveKey(config->arguments, "SOURCES.FILENAMES"); 278 } 279 280 if (haveSources) { 281 // Global list of sources for use as stamps 282 bool status = false; // Found the file? 283 if (havePSFs) { 284 pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSTACK.INPUT.SOURCES", 285 "PPSTACK.SOURCES"); 286 if (!status) { 287 psError(PS_ERR_IO, false, "Failed to load file definition PPSTACK.INPUT.SOURCES"); 288 return false; 289 } 290 if (sources && sources->type != PM_FPA_FILE_CMF) { 291 psError(PS_ERR_IO, true, "PPSTACK.SOURCES is not of type CMF"); 292 return false; 293 } 294 } 295 } 240 296 241 297 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "INPUTS.NUM", 0, "Number of input files", i); 242 298 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.PSF", 0, "Have PSFs available?", havePSFs); 299 psMetadataAddBool(config->arguments, PS_LIST_TAIL, "HAVE.SOURCES", 0, "Have global sources?", 300 haveSources); 243 301 244 302 // Output image … … 326 384 } 327 385 328 // Sources for use as stamps329 bool status = false; // Found the file?330 if (havePSFs) {331 pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSTACK.SOURCES", "PPSTACK.SOURCES");332 if (!status) {333 psError(PS_ERR_IO, false, "Failed to load file definition PPSTACK.SOURCES");334 return false;335 }336 if (sources && sources->type != PM_FPA_FILE_CMF) {337 psError(PS_ERR_IO, true, "PPSTACK.SOURCES is not of type CMF");338 return false;339 }340 }341 342 386 return true; 343 387 }
Note:
See TracChangeset
for help on using the changeset viewer.
