Movatterモバイル変換


[0]ホーム

URL:


NASA Logo, National Aeronautics and Space Administration

National Aeronautics and Space Administration

Goddard Space Flight Center

Sciences and Exploration

Search:

[Advanced Search]



Skip Navigation (press 2)
HEASARC: Software

fpack &funpack
FITS image compression programs


fpack is a utility program for optimally compressingFITSformat images. The companionfunpack program restores the compressed file back to its original state.These programs may be run from the host operating system command line andare analogous to thegzip and gunzip utility programs, except that they are specificallyoptimized for FITS format images and offer a wider choice of compression options.

fpack uses thetiled image compressionconvention for storing the compressed images. This convention can in principlesupport any number of of different compression algorithms; currently GZIP, Rice, Hcompress,and the IRAF pixel list compression algorithms have been implemented.

fpack also supports thetiled table compressionconvention for compressing FITS binary tables, which generally provides significantly greatercompression than can be achieved by simply compressing the FITS file with gzip.

The main advantages offpack compared to the commonly used techniqueof externally compressing the whole FITS file with gzip are:

  • It is generally faster and offers better compression than gzip.
  • The FITS header keywords remain uncompressed for fast access.
  • Each HDU of a multi-extension FITS file is compressed separately, soit is not necessary to uncompress the entire file to read a single image in a multi-extension file.
  • Dividing the image into tiles before compression enables faster access to small subsections of the image.
  • The compressed image is itself a valid FITS file and can be manipulated by other general FITS utility software.
  • Lossy compression can be used for much higher compression in cases where it is not necessary to exactly preserve the original pixel values.
  • The CHECKSUM keywords are automatically updated to helpverify the integrity of the files.
  • Software that supports the tiled image compression technique can directly read and write the FITS images in their compressed form.
  • can also compress FITS binary tables usinga newly proposed FITS convention. This is intended for experimental feasibility studies, notfor general use.

Integer format images are usually losslessly compressed using the Rice compression algorithm.As shown in the figure, the compression ratio depends on theRice vs. GZIP image compression amount of noise in the pixel values.Rice typically gives 30% better compression than GZIP. Rice also hasabout 3 times faster compression speed andabout the same uncompression speed as GZIP. SeePaper I for moredetails.

Floating-point format images are usually compressed with a lossy algorithmthat discards some of the noise in the image by quantizing the pixel values. A technique called "subtractive dithering" is used to minimize any statistical biasin the quantized values without introducing any additional noise in the image.SeePaper II formore details. As shown in the table, the amount of image compression, and the amountof precision that is preserved, depend on the selected q quantization parameter (whereq = 4 is the default value used by fpack).

qCompressionPrecision
85.3X0.06%
46.4X0.26%
28.0X1.03%
110.0X4.08%

More Detailed Documentation

  • User's Guide forfpack andfunpack (PDF format, 10 pages)
  • Paper I onlossless compression ofinteger FITS images by Pence, Seaman, and White.
  • Paper II onoptimal compressionof floating-point FITS imagesby Pence, White, and Seaman.
  • ADASS 2006 paper by Seaman et al.which describes the FITS Tile Compression Convention andimportance of data compression in astronomy.
  • ADASS 2009 floating-point image compression study(Poster),(Paper)presented at the October 2009 ADASS meeting in Sapporo, Japan.
  • ADASS 2010 study of a potential new way to compress FITS binary tables(Poster),(Paper)presented at the November 2010 ADASS meeting in Boston.
  • BZIP2 Feasibility Study: studies the performanceof BZIP2 compared to Rice, Hcompress, and GZIP. Concludes that BZIP2 offersno unique advantages that would justify supporting it in the tiled imagecompression convention.

Origins

Thefpack andfunpack utilities were originally designed and writtenby Rob Seaman (NOAO). William Pence (NASA/GSFC) added further enhancements to theutilities and to the image compression algorithms in the underlying CFITSIOlibrary. Rick White (STScI) wrote the code for the Rice and Hcompress algorithms.
How to get and use fpack and funpack
See theuser's guide for instructions on howto use fpack and funpack most effectively.

Source code: The fpack C source code is distributed with theCFITSIO library in the files fpack.cfunpack.c, fpackutil.c, & fpack.h (as well as the fpackguide.pdfuser's guide).

On most unix systems, build fpack and funpack by unpacking the CFITSIO tar file, then entering the following commands:

  • ./configure
  • make
  • make fpack
  • make funpack
On Windows PCs, fpack and funpack are automatically built when using CMAKE to build the CFITSIO library. See the README.win file that is distributed withCFITSIO for details.



[8]ページ先頭

©2009-2025 Movatter.jp