- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
pswarp/src (modified) (1 prop)
-
pswarp/src/pswarpLoop.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/pswarp/src
- Property svn:ignore
-
old new 13 13 config.h.in 14 14 stamp-h1 15 pswarpVersionDefinitions.h
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpLoop.c
r23352 r24244 142 142 psFree(resolved); 143 143 stats = psMetadataAlloc(); 144 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 144 145 } 145 146 … … 273 274 } 274 275 276 if (!output->data_exists) { 277 psWarning("No overlap between input and skycell."); 278 if (stats) { 279 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 280 "No overlap between input and skycell", PSWARP_ERR_NO_OVERLAP); 281 } 282 psphotFilesActivate(config, false); 283 psFree(cells); 284 psFree(view); 285 goto DONE; 286 } 287 275 288 pmCell *outCell = output->parent; ///< Output cell 276 289 pmChip *outChip = outCell->parent; ///< Output chip 277 290 pmFPA *outFPA = outChip->parent; ///< Output FP 278 291 279 if (!pswarpPixelFraction(output, stats, config)) { 280 // Don't write output images, and don't bother about anything else 281 output->data_exists = outCell->data_exists = outChip->data_exists = false; 292 if (!pswarpPixelsLit(output, stats, config)) { 293 psError(PS_ERR_UNKNOWN, false, "Unable to calculate pixel regions."); 282 294 psFree(cells); 283 295 psFree(view); 284 goto COMPLETED;296 return false; 285 297 } 286 298 287 299 // Set variance factor 288 300 { 289 float varFactor = psMetadataLookupF32(NULL, output->analysis, PSWARP_ANALYSIS_VARFACTOR); 290 psAssert(isfinite(varFactor), "Should be something here."); 291 long goodPix = psMetadataLookupS64(NULL, output->analysis, PSWARP_ANALYSIS_GOODPIX); 292 psAssert(goodPix > 0, "Should be something here."); 301 bool mdok; // Status of MD lookup 302 float varFactor = psMetadataLookupF32(&mdok, output->analysis, PSWARP_ANALYSIS_VARFACTOR); 303 long goodPix = psMetadataLookupS64(&mdok, output->analysis, PSWARP_ANALYSIS_GOODPIX); 293 304 varFactor /= goodPix; 294 305 … … 364 375 fileActivation(config, independentFiles, false); 365 376 366 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but that's going to be tricky.367 // We have a list of sources, so we use those to redetermine the PSF model.377 // We need a new PSF model for the warped frame. It would be good to generate this analytically, but 378 // that's going to be tricky. We have a list of sources, so we use those to redetermine the PSF model. 368 379 369 380 if (psMetadataLookupBool(&mdok, config->arguments, "PSF")) { … … 394 405 // measure the PSF using these sources 395 406 if (!psphotReadoutFindPSF(config, view, sources)) { 396 psError(PS_ERR_UNKNOWN, false, "Unable to determine PSF for warped image."); 397 return false; 407 // This is likely a data quality issue 408 // XXX Split into multiple cases using error codes? 409 psErrorStackPrint(stderr, "Unable to determine PSF"); 410 psWarning("Unable to determine PSF --- suspect bad data quality."); 411 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 412 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 413 "Unable to determine PSF", psErrorCodeLast()); 414 } 415 psErrorClear(); 416 psphotFilesActivate(config, false); 398 417 } 399 418 … … 448 467 // Now done with the skycell side of things 449 468 450 COMPLETED: 469 DONE: 470 451 471 // Write out summary statistics 452 472 if (stats) { … … 464 484 psFree((void*)statsMDC); 465 485 fclose(statsFile); 486 pmConfigRunFilenameAddWrite(config, "STATS", statsName); 466 487 467 488 psFree(stats); … … 471 492 psString dump_file = psMetadataLookupStr(&status, config->arguments, "DUMP_CONFIG"); 472 493 if (dump_file) { 473 pmFPAfile *input = psMetadataLookupPtr(NULL, config->files, "PSWARP.INPUT"); // Input file 474 pmConfigDump(config, input->fpa, dump_file); 494 pmConfigDump(config, dump_file); 475 495 } 476 496
Note:
See TracChangeset
for help on using the changeset viewer.
