Changeset 14868
- Timestamp:
- Sep 17, 2007, 11:35:35 AM (19 years ago)
- Location:
- trunk/psLib/src/fits
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFits.c
r12801 r14868 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.6 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2007-0 4-11 17:01:50$9 * @version $Revision: 1.66 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-09-17 21:35:35 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 562 562 563 563 564 bool psFitsSetCompression( 565 psFits* fits, ///< psFits object to close 566 psFitsCompressionType type, ///< type of compression 567 int ndim, ///< number of dim in tile size array 568 long *tilesize, ///< pointer to an array defining compression tile size 569 int noisebits, ///< noise bits 570 int scale, ///< hcompress scale 571 int smooth ///< hcompress smothing 572 ) 573 { 574 // convert psFitsCompressionType to cfitsio compression types 575 int comptype; 576 switch (type) { 577 case PS_FITS_COMPRESS_NONE: 578 comptype = 0x0; 579 break; 580 case PS_FITS_COMPRESS_GZIP: 581 comptype = GZIP_1; 582 break; 583 case PS_FITS_COMPRESS_RICE: 584 comptype = RICE_1; 585 break; 586 case PS_FITS_COMPRESS_HCOMPRESS: 587 comptype = HCOMPRESS_1; 588 break; 589 case PS_FITS_COMPRESS_PLIO: 590 comptype = PLIO_1; 591 break; 592 default: 593 psError(PS_ERR_UNKNOWN, true, "invalid psFitsCompressionType"); 594 return false; 595 } 596 597 int status = false; 598 fits_set_compression_type(fits->fd, comptype, &status); 599 if (!status) { 600 goto ERROR; 601 } 602 fits_set_tile_dim(fits->fd, ndim, tilesize, &status); 603 if (!status) { 604 goto ERROR; 605 } 606 fits_set_noise_bits(fits->fd, noisebits, &status); 607 if (!status) { 608 goto ERROR; 609 } 610 #if FITS_HCOMP 611 fits_set_hcomp_scale(fits->fd, scale, &status); 612 if (!status) { 613 goto ERROR; 614 } 615 fits_set_hcomp_smooth(fits->fd, smooth, &status); 616 if (!status) { 617 goto ERROR; 618 } 619 #endif // FITS_HCOMP 620 621 ERROR: 622 fits_set_compression_type(fits->fd, 0x0, &status); 623 psError(PS_ERR_UNKNOWN, true, "failed to configure compression - disabling"); 624 return false; 625 } 626 627 564 628 psDataType p_psFitsTypeFromCfitsio(int datatype) 565 629 { -
trunk/psLib/src/fits/psFits.h
r12554 r14868 4 4 * @author Robert DeSonia, MHPCC 5 5 * 6 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 3-23 00:34:40$6 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-09-17 21:35:35 $ 8 8 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 9 9 */ … … 34 34 PS_FITS_TYPE_ANY = ANY_HDU ///< Any HDU type 35 35 } psFitsType; 36 37 typedef enum { 38 PS_FITS_COMPRESS_NONE = 0, 39 PS_FITS_COMPRESS_GZIP, 40 PS_FITS_COMPRESS_RICE, 41 PS_FITS_COMPRESS_HCOMPRESS, 42 PS_FITS_COMPRESS_PLIO 43 } psFitsCompressionType; 36 44 37 45 /** FITS file object. … … 73 81 ); 74 82 83 /** Enables/configures FITS compression. 84 * 85 * Note that HCOMPRESS compression is not presently supported. 86 * 87 * @return bool TRUE if successfully configured, otherwise FALSE 88 */ 89 bool psFitsSetCompression( 90 psFits* fits, ///< psFits object to close 91 psFitsCompressionType type, ///< type of compression 92 int ndim, ///< number of dim in tile size array 93 long *tilesize, ///< pointer to an array defining compression tile size 94 int noisebits, ///< noise bits 95 int scale, ///< hcompress scale 96 int smooth ///< hcompress smothing 97 ); 98 75 99 /** Checks the type of a particular pointer. 76 100 *
Note:
See TracChangeset
for help on using the changeset viewer.
