Changeset 20844 for trunk/magic/remove/src/streaksremove.c
- Timestamp:
- Nov 25, 2008, 5:24:53 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksremove.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksremove.c
r20817 r20844 406 406 if (sf->stage == IPP_STAGE_CHIP) { 407 407 // For the chip level files, copy the WCS from the astrometry file to the header 408 updateAstrometry = true; 409 if (!pmAstromWriteWCS(sf->inImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) { 410 psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum); 411 streaksExit("", PS_EXIT_UNKNOWN_ERROR); 408 if (!sf->bilevelAstrometry) { 409 updateAstrometry = true; 410 if (!pmAstromWriteWCS(sf->inImage->header, sf->inAstrom->fpa, sf->chip, 0.001)) { 411 psError(PS_ERR_UNKNOWN, false, "failed to update astrometry for extension %d", sf->extnum); 412 streaksExit("", PS_EXIT_UNKNOWN_ERROR); 413 } 412 414 } 413 415 } … … 447 449 if (sf->inMask) { 448 450 readImage(sf->inMask, sf->extnum, sf->stage); 449 if (updateAstrometry) {450 pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001);451 }452 451 sf->outMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header); 453 452 if (sf->recMask) { 454 453 sf->recMask->header = (psMetadata*) psMemIncrRefCounter(sf->inMask->header); 455 454 } 455 if (updateAstrometry) { 456 pmAstromWriteWCS(sf->outMask->header, sf->inAstrom->fpa, sf->chip, 0.001); 457 } 456 458 457 459 setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, exciseAll); 458 460 461 #ifdef STREAKS_COMPRESS_OUTPUT 459 462 // XXX: see note above 460 463 copyFitsOptions(sf->outMask, sf->recMask, sf->inMask); 461 464 psFitsSetCompression(sf->outMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 462 psFitsSetCompression(sf->recMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 465 if (sf->recMask) { 466 psFitsSetCompression(sf->recMask->fits, PS_FITS_COMPRESS_PLIO, sf->tiles, 8, 0, 0); 467 } 468 #endif 463 469 } 464 470 465 471 if (sf->inWeight) { 466 472 readImage(sf->inWeight, sf->extnum, sf->stage); 467 if (updateAstrometry) {468 pmAstromWriteWCS(sf->inWeight->header, sf->inAstrom->fpa, sf->chip, 0.001);469 }470 473 sf->outWeight->header = (psMetadata*) psMemIncrRefCounter(sf->inWeight->header); 471 474 if (sf->recWeight) { 472 475 sf->recWeight->header = (psMetadata*) psMemIncrRefCounter(sf->inWeight->header); 473 476 } 474 setupImageRefs(sf->outMask, sf->recMask, sf->inMask, sf->extnum, exciseAll); 475 477 if (updateAstrometry) { 478 pmAstromWriteWCS(sf->inWeight->header, sf->inAstrom->fpa, sf->chip, 0.001); 479 } 480 setupImageRefs(sf->outWeight, sf->recWeight, sf->inWeight, sf->extnum, exciseAll); 481 482 #ifdef STREAKS_COMPRESS_OUTPUT 476 483 copyFitsOptions(sf->outWeight, sf->recWeight, sf->inWeight); 477 484 // XXX: see note above 478 485 psFitsSetCompression(sf->outWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 479 psFitsSetCompression(sf->recWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 480 } 481 486 if (sf->recWeight) { 487 psFitsSetCompression(sf->recWeight->fits, PS_FITS_COMPRESS_RICE, sf->tiles, 8, 0, 0); 488 } 489 #endif 490 } 482 491 // and for raw images, create sub images that represent the actual image 483 492 // area (no overscan) … … 611 620 612 621 if (sfiles->inWeight) { 613 double weightValue = psImageGet (sfiles->inWeight->image, x, y); 614 psImageSet (sfiles->recWeight->image, x, y, weightValue); 622 if (sfiles->recWeight) { 623 double weightValue = psImageGet (sfiles->inWeight->image, x, y); 624 psImageSet (sfiles->recWeight->image, x, y, weightValue); 625 } 615 626 psImageSet (sfiles->outWeight->image, x, y, NAN); 616 627 } 617 628 if (sfiles->inMask) { 618 double maskValue = psImageGet (sfiles->inMask->image, x, y); 619 psImageSet (sfiles->recMask->image, x, y, maskValue); 629 if (sfiles->recMask) { 630 double maskValue = psImageGet (sfiles->inMask->image, x, y); 631 psImageSet (sfiles->recMask->image, x, y, maskValue); 632 } 620 633 psImageSet (sfiles->outMask->image, x, y, newMaskValue); 621 634 }
Note:
See TracChangeset
for help on using the changeset viewer.
