Changeset 26477
- Timestamp:
- Dec 22, 2009, 2:39:53 PM (16 years ago)
- Location:
- trunk/magic/remove/src
- Files:
-
- 9 edited
-
isdestreaked.c (modified) (1 diff)
-
streaksVersion.c (modified) (4 diffs)
-
streaksastrom.c (modified) (1 diff)
-
streakscompare.c (modified) (1 diff)
-
streaksio.c (modified) (2 diffs)
-
streaksrelease.c (modified) (1 diff)
-
streaksremove.c (modified) (8 diffs)
-
streaksremove.h (modified) (2 diffs)
-
streaksreplace.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/isdestreaked.c
r25082 r26477 1 1 #include "streaksremove.h" 2 3 char *streaksProgram = "isdestreaked"; 2 4 3 5 int -
trunk/magic/remove/src/streaksVersion.c
r26438 r26477 38 38 psString source = streaksSource(); // Source 39 39 40 psStringPrepend(&version, " streaks ");40 psStringPrepend(&version, "%s ", streaksProgram); 41 41 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 42 42 psFree(source); … … 58 58 psString source = streaksSource(); // Software source 59 59 60 psStringPrepend(&version, " streaks version: ");61 psStringPrepend(&source, " streaks source: ");60 psStringPrepend(&version, "%s version: ", streaksProgram); 61 psStringPrepend(&source, "%s source: ", streaksProgram); 62 62 63 63 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, version); … … 78 78 psFree(time); 79 79 psString history = NULL; // History string 80 psStringAppend(&history, " streaks at %s", timeString);80 psStringAppend(&history, "%s at %s", streaksProgram, timeString); 81 81 psFree(timeString); 82 82 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history); … … 95 95 psString timeString = psTimeToISO(time); // The time in an ISO string 96 96 psFree(time); 97 psLogMsg("streaks", PS_LOG_INFO, " streaks at %s", timeString);97 psLogMsg("streaks", PS_LOG_INFO, "%s at %s", streaksProgram, timeString); 98 98 psFree(timeString); 99 99 -
trunk/magic/remove/src/streaksastrom.c
r25082 r26477 379 379 { 380 380 if (!pmAstromLinearizeTransforms((pmFPA *) astrom->fpa, (pmChip *) astrom->chip)) { 381 // streaksExit("linear fit to astrometry failed\n", PS_EXIT_UNKNOWN_ERROR); 382 psError(PS_ERR_UNKNOWN, false, "linear fit to astrometry failed ignoring"); 381 psErrorStackPrint(stderr, "linear fit to astrometry failed. ignoring\n"); 383 382 return false; 384 383 } -
trunk/magic/remove/src/streakscompare.c
r25082 r26477 1 1 #include "streaksremove.h" 2 3 char *streaksProgram = "streakscompare"; 2 4 3 5 static pmConfig * parseArguments(int, char **); -
trunk/magic/remove/src/streaksio.c
r26438 r26477 404 404 addDestreakKeyword(psMetadata *header) 405 405 { 406 streaksVersionHeaderFull(header); 406 407 psMetadataAddBool(header, PS_LIST_TAIL, "PSDESTRK", PS_META_REPLACE, 407 408 "Have streaks been removed from image?", true); … … 411 412 addRecoveryKeyword(psMetadata *header) 412 413 { 414 streaksVersionHeaderFull(header); 413 415 psMetadataAddBool(header, PS_LIST_TAIL, "PSRECOVR", PS_META_REPLACE, 414 416 "Does this image contain excised streak pixels?", true); -
trunk/magic/remove/src/streaksrelease.c
r26408 r26477 4 4 static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll); 5 5 static void writeImages(streakFiles *sf, bool exciseImageCube); 6 7 char *streaksProgram = "streaksrelease"; 6 8 7 9 int -
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 -
trunk/magic/remove/src/streaksremove.h
r26438 r26477 33 33 int yParity; 34 34 double exciseValue; 35 psString program; 35 36 } sFile; 36 37 38 // used for error messages 39 extern char * streaksProgram; 37 40 38 41 typedef enum { … … 96 99 extern void setStreakFiles( streakFiles *); 97 100 101 extern bool streaksVersionHeaderFull(psMetadata *header); 102 extern psString streaksVersionLong(void); 103 98 104 #define CHIP_LEVEL_INPUT(_stage) ((_stage == IPP_STAGE_RAW) || (_stage == IPP_STAGE_CHIP)) 99 105 #define USE_SUPPLIED_ASTROM(_stage) CHIP_LEVEL_INPUT(_stage) -
trunk/magic/remove/src/streaksreplace.c
r25082 r26477 5 5 static void writeImages(streakFiles *sf, bool exciseImageCube); 6 6 static bool readAndCopyToOutput(streakFiles *sf, bool restoreImageCube); 7 8 char *streaksProgram = "streaksreplace"; 7 9 8 10 int main(int argc, char *argv[])
Note:
See TracChangeset
for help on using the changeset viewer.
