Changeset 26477 for trunk/magic/remove/src/streaksremove.c
- Timestamp:
- Dec 22, 2009, 2:39:53 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksremove.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r26457 r26477 20 20 static long censorPixels(streakFiles *sfiles, psImage * pixels, bool checkNonDiffedPixels, psU16 maskStreak); 21 21 22 char *streaksProgram = "streaksremove"; 23 22 24 // Note: For clarity the flow of this program is in main(). 23 25 // There is not a lot of error checking is done in main. … … 109 111 psF64 cs_t = 0; 110 112 psF64 wi_t = 0; 113 psF64 ua_t = 0; 111 114 // Iterate through each component of the input (except for raw images there is only one) 112 115 do { … … 182 185 // chip processed files with the data calcuated by psastro at the camera stage 183 186 // (actually we use a linear approximation) 187 psTimerStart("UPDATE_ASTROMETRY"); 184 188 updateAstrometry(sfiles); 189 ua_t += psTimerClear("UPDATE_ASTROMETRY"); 190 psMetadataAddF32(sfiles->stats, PS_LIST_TAIL, "UPDATE_ASTROMETRY", PS_META_REPLACE, "", ua_t); 191 psLogMsg("streaksremove", PS_LOG_INFO, "time to update astrometry: %f\n", ua_t); 185 192 } 186 193 … … 544 551 updateAstrometry(streakFiles *sf) 545 552 { 546 // XXX: why do I check this here? Shouldn't it be just around the call to linearizeTransforms?547 553 if (sf->bilevelAstrometry) { 548 549 554 if (!linearizeTransforms(sf->astrom)) { 550 // fit failed, leave the astrometryunchanged555 // fit failed, leave the transform in the file unchanged 551 556 return; 552 557 } 553 554 if (!pmAstromWriteWCS(sf->outImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) { 555 psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum); 556 streaksExit("", PS_EXIT_UNKNOWN_ERROR); 557 } 558 if (sf->outMask) { 559 pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001); 560 } 561 if (sf->outWeight) { 562 pmAstromWriteWCS(sf->outWeight->header, sf->inAstrom->fpa, sf->chip, 0.001); 563 } 558 } 559 if (!pmAstromWriteWCS(sf->outImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) { 560 psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum); 561 streaksExit("", PS_EXIT_UNKNOWN_ERROR); 562 } 563 if (sf->outMask) { 564 pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001); 565 } 566 if (sf->outWeight) { 567 pmAstromWriteWCS(sf->outWeight->header, sf->inAstrom->fpa, sf->chip, 0.001); 564 568 } 565 569 } … … 579 583 readAndCopyToOutput(streakFiles *sf, bool exciseAll) 580 584 { 581 bool updateAstrometry = false;582 585 if (sf->inImage->pmfile) { 583 586 // image data from pmFPAfile (diff or warp file) … … 597 600 streaksExit("", PS_EXIT_UNKNOWN_ERROR); 598 601 } 599 // For the chip level files, copy the WCS from the astrometry file to the header600 // XXX: do we want to do this for raw images as well?601 if (sf->stage == IPP_STAGE_CHIP) {602 if (!sf->bilevelAstrometry) {603 updateAstrometry = true;604 if (!pmAstromWriteWCS(sf->inImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) {605 psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum);606 streaksExit("", PS_EXIT_UNKNOWN_ERROR);607 }608 }609 }610 602 sf->outImage->header = psMemIncrRefCounter(sf->inImage->header); 611 603 if (sf->recImage) { … … 640 632 } 641 633 addDestreakKeyword(sf->outMask->header); 642 if (updateAstrometry) {643 pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);644 }645 634 // Note: we don't excise the mask pixels even if exciseAll is true. 646 635 setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, false); … … 675 664 } 676 665 addDestreakKeyword(sf->outWeight->header); 677 if (updateAstrometry) {678 pmAstromWriteWCS(sf->inWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);679 }680 666 setupImageRefs(sf->outWeight, sf->recWeight, sf->inWeight, sf->extnum, exciseAll); 681 667
Note:
See TracChangeset
for help on using the changeset viewer.
