Investigation of the latest FITS standard and the use of the CFITSIO library to upgrade FITS in GIPSY


M.G.R. Vogelaar & J.P. Terlouw
Kapteyn Institute
Groningen
The Netherlands

vogelaar@astro.rug.nl
terlouw@astro.rug.nl


Sep 1998





Short FITS primer (from the CFITSIO documentation)

A FITS file consists of one or more Header + Data Units (HDUs), where the first HDU is called the `Primary HDU', or `Primary Array'. The primary array contains an N-dimensional array of pixels, such as a 1-D spectrum, a 2-D image, or a 3-D data cube. Five different primary datatypes are supported: Unsigned 8-bit bytes, 16 and 32-bit signed integers, and 32 and 64-bit floating point reals. FITS also has a convention for storing 16 and 32-bit unsigned integers (see the later section entitled `Unsigned Integers' for more details). The primary HDU may also consist of only a header with a null array containing no data pixels.

Any number of additional HDUs may follow the primary array; these additional HDUs are called FITS `extensions'. There are currently 3 types of extensions defined by the FITS standard:

Currently GIPSY recognizes only image extensions. CFITSIO supports also extended FITS file names like file://, ftp:// and http:// and supports compressed files. None of these options is available in GIPSY.


Testing the library

Local experiments with the CFITSIO library require a special vesion of the 'giplib' library which can be found in $gip_lib/TEST (see README in that directory) itself. A template GIPSY program is made by GIPSY program CODER. 'Compile' must be aware of the location of the special library; this is done with setenv gip_lib $gip_lib/TEST Experiments show that the library functions are easy to use and work as described.

Changing compile to include the library

For a permanent solution, we probaly should change 'Compile' to allow compilation of an external library. Kor is asked to think about a solution. First we try to compile the CFITSIO library for different platforms and run a test program to look for unexpected behavior. If no problems occur, we should start writing an updated FITS reader/writer based on CFITSIO as soon as possible.

Documentation

Documentation of the CFITSIO library need not to be converted to the GIPSY standard dc2 documentation. At most two applications require the library. There is a HTML version of the documentation which we can copy into our own GIPSY documentation tree. A PostScript version of the CFITSIO documentation is also available.

The RWFITS program

A new GIPSY program to read and write FITS files should include all functionality found in programs RFITS and WFITS. Special care should be given to coordinate systems. The new program can be used in two modes. The first mode uses a GUI in which the proposed translation of FITS keywords to GDS keywords can be manipulated. The second mode operates without a gui. It transforms the FITS file to a GDS file without any (graphical) user interaction.