Astronomical spectral data inherently have three coordinates. Every spectral element has a position (typically on the sky) defining the source of the radiation as well as the energy of the radiation. For raster binned data where one needs to relate the bin coordinate to position and energy the FITS WCS methods can be applied. In this document we define a convention for representing all such binned astronomical spectral data by at least a three-dimensional FITS WCS.
Raster binned spectral data are stored in images or as image elements in a table in one, two, three, or higher dimensional arrays. Clearly for three or higher dimensional arrays the FITS WCS would be of the same dimensionality. But for one and two dimensional images a three dimensional WCS is still appropriate. The advantage of this is that the source of the radiation is maintained in a standard WCS rather than some less standard keyword (though standardization of source keywords is still desirable).
The convention is quite simple. All spectra should have a least three world coordinate axes. The main complexity is how to deal with the missing dimensions in one and two dimensional image arrays. There are two ways, as described in Proposal on FITS WCS Dimensionality , consisting of either using dummy image dimensions or simply counting the WCS CTYPE keywords.
The most complex case for spectral data of reduced dimensionality, which is also the most common in optical astronomy, is two dimensional dispersed imaging. Typically there is an entrance aperture on the sky to limit the source of radiation to a point or a line and the light is then dispersed perpendicular to the aperture and recorded on a two dimensional detector such as a CCD. There is then a spatial dimension and a spectral dimension in the 2D image. Relating the one spatial image axis, using the dimensional reduction technique, to two celestial coordinates is then what the FITS WCS provides.
Another aspect of the inherently three dimensional spectral data is that due to instrumental distortions there may be coupling of the spatial and wavelength axes. For instance the direction of dispersion on a 2D detector may not be a simple line and the wavelength may vary with spatial position due to distortions or apertures shapes. The coupling of spatial and spectral axes and dealing with instrumental distortions is discussed in Functional Corrections and Axes Coupling in FITS WCS .
This paper gives examples for for 1D, 2D, and 3D spectral data. These are the same examples as found in the axes coupling paper. The examples make use of the Proposal on FITS WCS Dimensionalilty . In this proposal the NDIM/NAXIS keywords are for the dimensionality of the pixel array without adding dummy axes of length 1. The WCS dimension is three as determined from the presence of CTYPE1, CTYPE2, and CTYPE3 keywords.
In this example a one dimensional, 1000 point, spectrum with a non-linear (quadratic) dispersion is described by a three dimensional WCS.
NAXIS = 1 / Number of image raster axes NAXIS1 = 1000 / Number of pixels CTYPE1 = 'WAVE-WAV-PLY' / Wavelength axis CUNIT1 = 'Angstrom' / Wavelength units CRVAL1 = 5560. / Wavelength (Angstrom) CRPIX1 = 500. / Reference pixel CD1_1 = 2.1 / Linear dispersion (Angstrom/pixel) DV1_0 = 2 / Order of non-linear function DV1_2 = 499. / Normalization DV1_6 = 5. / Maximum quadratic deviation CTYPE2 = 'RA---TAN' / RA axis CRVAL2 = 201.94541667302 / RA reference (deg) CD2_2 = -2.1277777E-4 / RA axis scale (deg/pixel) CRPIX2 = 1. / Reference pixel CTYPE3 = 'DEC--TAN' / DEC axis CRVAL3 = 47.45444 / DEC reference (deg) CD3_3 = 2.1277777E-4 / DEC axis scale (deg/pixel) CRPIX3 = 1. / Reference pixel
What this WCS tells us is that the source of the radiation is right ascension 13:27:46.9 hours and declination 47:27:16 degrees. The wavelength is
w = 5560 + 2.1 (p - 500) * (1 + 10.2 (p - 500) / 2500)
A slit is centered at some celestial coordinate and oriented with some position angle. The slit image is dispersed and imaged on a 2D detector. For simplicity in this example the slit is placed at (12h, 32d) and the length is aligned with right ascension. The pixel scales are approximately 1 arcsecond per pixel along the spatial axis and 10 Angstroms per pixel along the dispersion axis. The detected image is 470x100 with the dispersion along the longer first axis.
We define a three dimensional WCS, one dispersion and two spatial axes, in which one spatial axis is reduced to a single pixel corresponding to the missing third image dimension. The position of the slit on the sky defines the coordinate reference value and the orientation of the slit on the sky and the pixel scales define the CD terms.
The keywords for this WCS with coupled polynomial corrections is given below.
NAXIS = 2 / Number of image raster axes NAXIS1 = 100 / Number of pixels NAXIS2 = 470 / Number of pixels CTYPE1 = 'WAVE-WAV-PLY' / Wavelength axis with distortion CRUNIT1 = 'Angstrom' / Wavelength unit CRVAL1 = 5560. / Reference wavelength (Angstrom) CD1_1 = 10. / Wavelength scale (Angstrom/pixel) CRPIX1 = 256. / Reference pixel DV1_0 = 2. / 2nd order in wavelength DV1_1 = 2. / 2nd order in RA DV1_4 = 2569. / Wavelength normalization DV1_5 = -0.9858 / RA normalization DV1_12 = 500. / Wavelength=wavelength^2 coefficient DV1_16 = 50. / Wavelength=RA^2 coefficient CTYPE2 = 'RA---TAN-PLY' / RA axis with distortion CRVAL2 = 180. / Reference RA (deg) CD2_2 = 2.7778E-4 / RA scale (deg) CRPIX2 = 50. / Reference pixel DV2_0 = 3. / 3rd order in wavelength DV2_4 = 2569. / Wavelength normalization DV2_12 = 0.0013889 / RA=wavelength^2 coefficient DV2_13 = 0.0027778 / RA=wavelength^3 coefficient CTYPE3 = 'DEC--TAN-PLY' / DEC axis with distortion CRVAL3 = 32. / Reference DEC (deg) CD3_3 = 2.7778E-4 / DEC scale (deg) CRPIX3 = 1. / Reference pixel
Figure 3 shows a display of the 2D image with lines of constant wavelength and right ascension overlayed. The grid is also in constant intervals of the world coordinates. Because of the non-linear dispersion the horizontal (wavelength) grid intervals are non-uniform. Because of distortions and a curved slit the lines of constant spatial position and wavelength are not straight. This example has been exaggerated over a typical long slit spectrum to illustrate the form.
Imaging through an interference filter, such as occurs when using a scanning Fabry-Perot instrument, produces a spatially dependent wavelength. This is a three-dimensional function in which two of the axes are spatial and the third is spectral. The basic distortion in wavelength as a function of spatial position is
w = w(0) cos (arctan (r/C)) = w(0) / sqrt (1 + (r/C)^2)where w(0) is the wavelength at the optical axis. How this is represented in a WCS is given in Functional Corrections and Axes Coupling in FITS WCS .
Figures 4 and 5 show an artificial example of a Fabry-Perot data cube. In the example the wavelength steps along the third image dimension are linear but have the basic interference filter behavior as a function of position in the spatial image plane. The spatial coordinates have a pincushion distortion. Figure 4 presents the WCS keywords.
Figure 5 displays two planes of the data cube. The left display is for a spatial plane. The lines of constant RA and DEC, in equal increments, are overlayed in yellow. Lines of constant wavelength, also in equal intervals, appear as red circles. The circles are not equally spaced in radius because of the basic r^2 behavior.
The display on the right is a plane with wavelength along the horizontal dimension and RA along the vertical dimension. Lines of constant wavelength and RA, in equal increments, are overlayed. Note the curvature of the wavelength grid and the night sky spectral lines.
NAXIS = 3 / Number of image raster axes NAXIS1 = 512 / Number of pixels NAXIS2 = 512 / Number of pixels NAXIS3 = 512 / Number of pixels CTYPE1 = 'RA---TAN-PLY' / RA---TAN with distortion CRVAL1 = 201.94541667302 / RA reference (deg) CD1_1 = -2.1277777E-4 / RA axis scale (deg/pixel) CRPIX1 = 257.75 / Reference pixel DV1_0 = 1 / Up to 1st order in x DV1_3 = 1 / Up to 1st order in r DV1_7 = 1 / Include x in r DV1_8 = 1 / Include y in r DV1_13 = -3. / xr coefficient CTYPE2 = 'DEC--TAN-PLY' / DEC--TAN with distortion CRVAL2 = 47.45444 / DEC reference (deg) CD2_2 = 2.1277777E-4 / DEC axis scale (deg/pixel) CRPIX2 = 258.93 / Reference pixel DV2_1 = 1 / Up to 1st order in y DV2_3 = 1 / Up to 1st order in r DV2_7 = 1 / Include x in r DV2_8 = 1 / Include y in r DV2_13 = -3. / yr coefficient CTYPE3 = 'WAVE-WAV-PLY' / WAVE-WAV with interference filter CUNIT3 = 'Angstrom' / Units CRVAL3 = 5560. / Wavelength (Angstrom) CD3_3 = -1. / Wavelength scale (Angstrom) CRPIX3 = 256. / Reference pixel DV3_2 = 1 / Up to 1st order in z DV3_3 = 4 / Up to 4th order in r DV3_6 = 5559. / Normalization (CRVAL-1) DV3_7 = 1.38 / (1/C) DV3_8 = 1.38 / (1/C) DV3_14 = -2780. / r^2 coefficient (-0.5*CRVAL) DV3_15 = -2780. / zr^2 coefficient (-0.5*CRVAL) DV1_18 = 2085. / r^4 coefficient (3/8*CRVAL) DV1_19 = 2085. / zr^4 coefficient (3/8*CRVAL)