Changeset 20730 for trunk/magic/remove/src/streaksremove.c
- Timestamp:
- Nov 13, 2008, 2:23:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksremove.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r20708 r20730 2 2 #include "libgen.h" 3 3 #include "unistd.h" 4 5 // XXX: I don't think we need the lock and unlock functions6 extern bool sFileLock(sFile * sfile);7 extern bool sFileUnlock(sFile * sfile);8 extern bool sFileReplace(sFile *dest, sFile *src);9 4 10 5 static nebServer *ourNebServer = NULL; … … 343 338 344 339 return sf; 345 }346 347 348 bool349 streakFilesLock(streakFiles *sf)350 {351 if (sf->inImage->inNebulous ) {352 // TODO: make the nebulous call to lock the file353 }354 return true;355 }356 bool357 streakFilesUnlock(streakFiles *sf)358 {359 if (sf->inImage->inNebulous ) {360 // TODO: make the nebulous call to unlock the file361 }362 return true;363 340 } 364 341 … … 535 512 return NULL; 536 513 } 537 psMetadataAddStr(config->arguments, PS_LIST_TAIL, " MASK", 0,514 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "INPUT.MASK", 0, 538 515 "name of input mask image", argv[argnum]); 539 516 psArgumentRemove(argnum, &argc, argv); … … 547 524 return NULL; 548 525 } 549 psMetadataAddStr(config->arguments, PS_LIST_TAIL, " WEIGHT", 0,526 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "INPUT.WEIGHT", 0, 550 527 "name of input weight image", argv[argnum]); 551 528 psArgumentRemove(argnum, &argc, argv); … … 611 588 streaksremoveExit("", PS_EXIT_DATA_ERROR); 612 589 } 590 613 591 614 592 // TODO: add keyword indicating that streaks have been removed … … 895 873 readAndCopyToOutput(streakFiles *sf) 896 874 { 875 bool updateAstrometry = false; 897 876 if (sf->inImage->pmfile) { 898 877 // image data from pmFPAfile (diff or warp file) … … 909 888 } 910 889 if (!sf->astrom) { 911 psError(PS_ERR_UNKNOWN, false, "failed to set up astrometry for ext nsion %d", sf->extnum);890 psError(PS_ERR_UNKNOWN, false, "failed to set up astrometry for extension %d", sf->extnum); 912 891 streaksremoveExit("", PS_EXIT_UNKNOWN_ERROR); 892 } 893 if (sf->stage == IPP_STAGE_CHIP) { 894 // For the chip level files, copy the WCS from the astrometry file to the header 895 updateAstrometry = true; 896 if (!pmAstromWriteWCS(sf->inImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) { 897 psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum); 898 streaksremoveExit("", PS_EXIT_UNKNOWN_ERROR); 899 } 913 900 } 914 901 sf->outImage->header = (psMetadata*) psMemIncrRefCounter(sf->inImage->header); … … 930 917 931 918 // set up the compression parameters 932 //copyFitsOptions(sf->outImage, sf->recImage, sf->inImage);919 // copyFitsOptions(sf->outImage, sf->recImage, sf->inImage); 933 920 934 921 // XXX: TODO: can we derive these values from the input header? 935 922 // psFitsCompressionGet(sf->inImage->image) gives compression none 936 923 // perhaps we should just use the definition of COMP_IMG in the configuration 937 // psFitsSetCompression(sf->outImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 924 // psFitsSetCompression(sf->outImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 925 938 926 psFitsSetCompression(sf->recImage->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 939 927 … … 941 929 readImage(sf->inMask, sf->extnum, sf->stage); 942 930 sf->outMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header); 931 if (updateAstrometry) { 932 pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001); 933 } 943 934 sf->outMask->image = (psImage*) psMemIncrRefCounter(sf->inMask->image); 944 935 sf->recMask->image = (psImage*) psMemIncrRefCounter(sf->inMask->image); … … 955 946 readImage(sf->inWeight, sf->extnum, sf->stage); 956 947 sf->outWeight->header = (psMetadata*) psMemIncrRefCounter(sf->inWeight->header); 948 if (updateAstrometry) { 949 pmAstromWriteWCS(sf->outWeight->header, sf->inAstrom->fpa, sf->chip, 0.001); 950 } 957 951 sf->outWeight->image = (psImage*) psMemIncrRefCounter(sf->inWeight->image); 958 952 … … 1450 1444 computeWarpedPixels(sfiles); 1451 1445 } 1446 1452 1447 1453 1448 if (sfiles->stage == IPP_STAGE_RAW) {
Note:
See TracChangeset
for help on using the changeset viewer.
