CADC The Canadian Astronomy Data Centre
If you have used CADC facilities for your research, please include the following acknowledgment:
This research used the facilities of the Canadian Astronomy Data Centre operated
by the National Research Council of Canada with the support of the Canadian Space Agency.
   About  |  Register  |  Contact
 
 Advanced Search

MegaPrime CFITSIO/RICE Image Compression

Introduction

MegaPrime images distributed by CADC to registered members of CFHTLS community have been compressed using the RICE algorithm as implemented in NASA's HEARSARC CFITSIO library. Please consult the data compression section of the CFITSIO web site for more details. This procedure offers several advantages over the more widespread "gzip":

  • It offers faster and more efficient compression. This is vital for the distribution of images as large as those produced by MegaPrime over the networks.
  • Headers for all extensions are still visible in compressed images.
  • Decompression can be performed on a single extension if desired.
  • The NOAO/IRAF group is currently working to implement this type of compression inside the IRAF FITS kernel. Once this work has been completed, installing the CFITSIO package (see below) will no longer be necessary.

CFITSIO Installation

To decompress MegaPrime images, you will need the CFITSIO imcopy utility. This utility is included in version 2.440 (or later) of the CFITSIO package. You can install CFITSIO by following these steps:

  • Download the CFITSIO source code package (tar or zip file) from the CFITSIO web site.
  • Go to Section 2 of the CFITSIO Quick Start Guide and follow the configure, make, make install steps in this section to compile CFITSIO.
  • You can now compile the imcopy utility (imcopy.c) using the command:
    gcc -o imcopy imcopy.c -L. -lcfitsio -lm -lnsl -lsocket
If you encounter problems with your CFITSIO installation, please contact CADC.

CFITSIO imcopy usage examples

Note that the names of images compressed with CFITSIO/RICE were given the suffix ".fz". In addition to the imcopy usage examples provided on the CFITSIO web site, other important examples include:
  • Decompressing nth extension of image sci_image.fits.fz:
    imcopy sci_image.fits.fz[n] new_sci_image.fits