[fitsbits] FITS size calculation

William Pence pence at tetra.gsfc.nasa.gov
Tue May 27 13:22:05 EDT 2003


Malapert Jean-Christophe wrote:
> 
> Perhaps a daft question but I've not found the answer in the FITS
> documentation.
> 
> Is it possible to calculate the FITS file size of a compressed image
> with a RICE-compression ?

Are you referring to the tiled image compression convention  (see
http://heasarc.gsfc.nasa.gov/docs/heasarc/fits/compress/compress_image.html)
that is supported by CFITSIO?  If so, there is no way to predict ahead of
time how big the compressed image will be because the compression factor
depends to some extent upon the details within each image.  Images with a
smooth background will compress better than noisy images.

Once the image has been compressed and stored in a FITS binary table
extension, the size of that extension can be calculated in the usual way
from the values of the BITPIX, GCOUNT, PCOUNT, and NAXISn keywords.  The
dimensions of the uncompressed image are given by the ZNAXISn keywords.

Bill Pence 
-- 
____________________________________________________________________
Dr. William Pence                          William.D.Pence at nasa.gov
NASA/GSFC Code 662         HEASARC         +1-301-286-4599 (voice)     
Greenbelt MD 20771                         +1-301-286-1684 (fax)




More information about the fitsbits mailing list