There is, as yet, no formal agreement or convention on encoding spectra from random positions on the sky in FITS format. Conventions for describing the mapping between pixel number and frequency need to be developed. In fact, there has not even been agreement on whether frequency should be the only independent variable for spectroscopic data exchange or whether wavelength also should be used. Section 4.2.1 discusses one proposal for attaching multiple labels to one axis. While the resolution of these issues is outside the scope of this User's Guide, it is important to recognize that they exist.
Spectra can be transmitted as one-dimensional arrays, using the Basic FITS format with NAXIS = 1. However, such usage is inefficient. Each spectrum would have its own header. Spectroscopic observations generally need more ancillary parameters than do images. The header may easily use more bytes than the data. Approaches that would reduce header overhead are needed.
It may be possible to encode many spectra in a single array by adding a second dimension--scan number. Information about the entire set of observations would appear in the primary header; information about the individual scans would appear in a table extension or extensions following the data. This choice has the advantage that the data format is the one most widely and easily read. A principal disadvantage is that the ancillary information for individual scans is separated from the results of the observations.
If there are not too many parameters and the individual spectrum vectors are not long, ASCII tables may be a convenient format. One row would correspond to an observation, containing the ancillary information and the results. Each wavelength would be a separate field of the table, and the other fields would contain the ancillary parameters. However, as the spectra become longer and the number of points in a data set increases, the inefficiencies in use of space by the ASCII table format become a serious problem.
Space can be reduced by using binary tables. The binary form is more compact than the ASCII representation, especially for exponential formats and numbers with many significant digits. Also, because many machines are now storing floating point numbers internally in IEEE format, using binary tables eliminates time and cost associated with internal conversion in the machine. Again, one row corresponds to one observation, but now the spectrum vector appears formally as a single field. Parameters whose values are constant for the entire set of observations would remain in the header, while those applying to a single observation matrix would appear in the same row of the table. Example 4 in Appendix A presents the header that might be written for a simplified binary table structure for spectra proposed by D. Wells.