FITS (Flexible Image Transport System) is a data format that is in widespread use by the astronomical community. CFITSIO is a popular C library that interfaces to such files and provides support for all features of the format. Moreover CFITSIO supports a number of unofficial or proposed FITS conventions that are in widespread use.
This package makes use of the CFITSIO library allow one to manipulate FITS files from the S-lang interpreter. The package consists of two interfaces: a high level interface and a low level one. The low level interface is implemented as a module and is more or less a straightforward wrapping of the functions of the CFITSIO library. Functions from this interface are prefixed with an underscore to indicate that they are part of the low-level interface. The high level interface is written in S-lang and makes use of functions from the low level interface. While there is some overlap with the semantics of the CFITSIO library, the high level interface should be regarded as a separate interface to fits files.
To illustrate the difference between the two interfaces, consider the
_fits_read_col function and its high level
fits_read_col. The low-level function reads a
single column, specified via the column number, from a fits binary
table and performs a minimal amount of error checking. In contrast,
fits_read_col is a high level function that reads one or more
columns, specified either as column numbers or named columns, from a
table and does so in a way that takes into account the way CFITSIO
performs buffering for maximum efficiency. Moreover, the high level
function checks for the presence of TDIM keywords or columns to give
the arrays it returns the proper dimensionality. If any errors
occur, the function will throw an exception.