Reading individual spectrum files
Every SDSS spectrum is stored in a so-called spSpec file. This file contains the spectrum
along with derived quantities such as redshift, classification, tables of line fits and line indices, etc..
The spSpec naming convention is
spSpec-mmmmm-pppp-fff.fit, where mmmmm
refers to the mjd of observation, pppp the plate number and
fff the fiber number. There are 291 different plate/mjd
combinations in the dr1 data, while the fiber numbers runs from
from 1 to 640.
The spSpec file is a fits image with binary table extensions. Here
we provide a overview of the contents of an spSpec file; please
consult the spSpec data
model page for complete details.
The spSpec file's header contains several parameters such as object
identification and coordinates, observing information, spectral
classification, redshift, etc.. The fits image contains a 4x(roughly
4000) image whose first row is the spectrum, second the continuum
subtracted spectrum, third the error, and forth a bitmask. Notice
that the wavelength vector is not contained in the image, but must be
generated from parameters in the header. SDSS spectra are binned in
constant Log( ) and the wavelength can be obtained
from the header parameters COEFF0 and COEFF1 (or alternatively CRVAL1
and CD1_1) as follows:
= 10(COEFF0 +
COEFF1*i), where i denotes the (zero
indexed) pixel number.
Remember that these are vacuum
wavelengths. Six binary tables are included, most importantly HDU
2 which contains a table of gaussian fits to line positions, and HDU 3
which contains a table on line index parameters. Also included, but
of less general interest, are: HDU 1 which contains line parameters
used in the emission-line redshift determination; HDU 3 which
contains information on emission-line redshifts; HDU 4 which contains
a table of cross-correlation redshifts with all the templates, and HDU
6 which has additional mask information as well as the spectral
resolution as a function of wavelength.
One can read them using standard
FITS IO libraries. Alternatively, one can use routines in IDL,
SM, MIDAS, and IRAF to read them. Additionally the Space Telescope
Science Institute's SpecView
utility is capable of displaying spSpec files. You can also use
Pat Halls' IRAF routines for displaying SDSS spectra.
We provide example SM code which plots a spectrum and lists some information contained in the
spSpec file (see
the SM homepage
if you don't have SM). Here is a page on
how to display SDSS spectra with IRAF.
Last modified: Mon Mar 8 17:17:19 CST 2004