The template program below shows how CFITSIO routines can be used to
read the data structures (DSS image and 2dFGRS object spectrum, variance
array and sky spectrum) in the 2dFGRS database FITS files of each object
in the survey. It is designed to be simple, and demonstrates the basic
operations required to open the file, read the data in the images and
the data in the keywords, and move through the extensions. Trivial
routines for data manipulation are provided. The program takes a
filename as an argument, determines the number of spectral extensions
(number of times observed), and prompts for the spectral extension to
read the data from. The template program and the accompanying example
program should provide a code base for analyses of the 2dFGRS spectra.

A note for IRAF users: with multiple-extension FITS files, the
filename requires the suffix [n], where n is the extension number
(primary image is extension 0, spectrum images are extensions
1..spectra). For example, to display the DSS image of 123456.fits, use
the comand DISPLAY 123456[0] 1. To display the first object spectrum,
variance array and sky spectrum, use DISPLAY 123456[1] 2.