Changeset 18208
- Timestamp:
- Jun 19, 2008, 4:50:01 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsImage.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsImage.c
r18156 r18208 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2008-06- 17 02:46:05$9 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-06-20 02:50:01 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 534 534 } 535 535 536 bool useRequestedScale = true; 536 537 if (!isfinite(bscale) || !isfinite(bzero)) { 537 538 // Couldn't scale, so don't compress. Save compression parameters for later 539 useRequestedScale = false; 538 540 compress = psFitsCompressionGet(fits); 539 541 if (!psFitsSetCompression(fits, PS_FITS_COMPRESS_NONE, NULL, 0, 0, 0)) { … … 556 558 bzero = cfitsioBzero; 557 559 } 560 558 561 psFitsOptions *options = fits->options; // FITS I/O options 559 psAssert(! options || bitPix == options->bitpix || options->bitpix == 0, "impossible");562 psAssert(!useRequestedScale || !options || bitPix == options->bitpix || options->bitpix == 0, "impossible"); 560 563 561 564 int naxis = 3; // Number of axes … … 603 606 fits_set_bscale(fits->fd, 1.0, cfitsioBzero, &status); 604 607 605 if ( bscale != 0.0) {608 if (isfinite(bzero) && isfinite(bscale) && (bscale != 0.0)) { 606 609 fits_write_key_dbl(fits->fd, "BZERO", bzero, 12, 607 610 "Scaling: TRUE = BZERO + BSCALE * DISK", &status); … … 693 696 } 694 697 698 bool useRequestedScale = true; 695 699 if (!isfinite(bscale) || !isfinite(bzero)) { 696 700 // Couldn't scale, so don't compress. Save compression parameters for later 701 useRequestedScale = false; 697 702 compress = psFitsCompressionGet(fits); 698 703 if (!psFitsSetCompression(fits, PS_FITS_COMPRESS_NONE, NULL, 0, 0, 0)) { … … 716 721 } 717 722 psFitsOptions *options = fits->options; // FITS I/O options 718 psAssert(! options || bitPix == options->bitpix || options->bitpix == 0, "impossible");723 psAssert(!useRequestedScale || !options || bitPix == options->bitpix || options->bitpix == 0, "impossible"); 719 724 720 725 // Check to see if the HDU has the same datatype
Note:
See TracChangeset
for help on using the changeset viewer.
