ASCL.net

Astrophysics Source Code Library

Making codes discoverable since 1999

Searching for codes credited to 'White, Rick'

Tip! Refine or expand your search. Authors are sometimes listed as 'Smith, J. K.' instead of 'Smith, John' so it is useful to search for last names only. Note this is currently a simple phrase search.

[ascl:1010.002] fpack: FITS Image Compression Program

fpack is a utility program for optimally compressing images in the FITS data format. The associated funpack program will restore the compressed file back to its original state. These programs may be run from the host operating system command line and are analogous to the gzip and gunzip utility programs, except that they are specifically optimized for FITS format images and offer a wider choice of compression options.

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

The main advantages of fpack compared to the commonly used technique of 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, so it 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 image.
- The CHECKSUM keywords are automatically updated to help verify 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.