;; Specify the file to read.
file = "HUT224401cal.fits"
;; Read in HDU2, the second extension, which contains the night-only spectrum.
;; We make use of the Goddard Astronomy Library function MRDFITS.
;; The return value is an IDL structure when the extension is a binary fits table.
fits_exten2_data = MRDFITS(file, 2, fits_exten2_hdr, /SILENT)
;; Create variables that store the wavelength and flux in 1-D arrays.
wls = fits_exten2_data.wave
fls = fits_exten2_data.flux
;; Plot the spectrum.
PLOT, wls, fls, LINESTYLE=0, /YNOZERO
The HUT team has also provided a set of C routines to read in the idf.fits files and create cal.fits files. This can be useful if, for example, you wish to modify the inclusion/exclusion of particular photons to re-create a new spectrum. The package can be downloaded here in a gzipped tarball, which contains the necessary C program files, Makefile, and README.