IRAF Tutorial

How do I view Individual Spectrum Files in IRAF?

The IRAF package has been traditionally used in astronomy for various data analysis tasks. For SDSS data, the splot task has been used to view individual spectrum files. However, splot only understands spectrum files formatted in a specific way. In SDSS DR7 and prior, files were formatted in a manner consistent with splot. If you retrieve these files from DR7, you should have no problem viewing them in IRAF.

Because the structure of spSpec is very constrained, and because the pipeline that originally produced them is no longer used, starting in DR9 we have a new type of individual spectrum file, called a spec file. In a spec file, wavelength, flux, and other data are stored in a FITS binary table. We have a detailed data model for spec files. These files contain quite a bit more data than the old spSpec files.

To extract and plot spectra from spec files in IRAF, we recommend having the STSDAS tables package installed. Hodge (1996) shows how to extract and plot data from a FITS binary table, using the tables package.

There is an external add-on package called SPLIB that added support for spectra in various tabular formats. It does require setting up a database to define which columns map to which local spectrum quantity, and may not be straightforward to install. Recent installs of IRAF may already have the necessary infrastructure to support SPLIB. The SPTABLE package can splot SDSS and eBOSS files. However, the installation may not work on Mac, and a user has to run an IRAF command on a file to convert to linear wavelength to have splot working correctly, and hence almost all the spectroscopy tasks.

There is an alternative of extracting columns from the files and converting them to the ‘onedspec’ image format (that is, the equivalent of the DR7 spSpec file). There may be limitations arising from the fact that spec files have a logarithmic wavelength sampling.

We recommend that users use Python or IDL instead to work with SDSS data. Python users may want to use SciServer to work with SDSS spectra.