Supporting these data structures is an I/O interface module called HSTIO. High-level functions in the HSTIO interface include: 1) functions to initialize all data structures, to allocate and free memory needed by the data structures, 2) macros to access elements of the two-dimensional data arrays, 3) functions to get and set values associated with header keywords, 4) functions to read and write entire Science, Error, and Data Quality HDUs, as well as NICMOS Samples and Integration Times HDUs, 5) functions to read and write single and multiple groups of {Science, Error, Data Quality} or, for NICMOS, groups of {Science, Error, Data Quality, Samples, Integration Times}. These functions recognize local conventions used in conjunction with the various HDUs, and generate arrays of the proper dimensionality and value.
The HSTIO interface also includes a number of lower-level functions that can be used if there is insufficient memory to store entire HDUs. These include: 1) opening and closing a particular image in a FITS file, 2) reading and writing the FITS header associated with an image, 3) reading and writing the data array associated with an image, and 4) reading and writing arbitrary lines or arbitrary two-dimensional sections of a data array associated with an image.
The structure of the software is shown in Figure 1. All of the high-level functions are implemented in terms of the lower-level functions. These lower-level functions are implemented using IRAF's image I/O, enhanced by the addition of the FITS kernel with support for image extensions.
Figure 1: HSTIO Interface