Next: New Developments in the FITSIO and Fv Software Packages
Up: Applications
Previous: Robust, Realtime Bandpass Removal for the HI Parkes All Sky Survey Project using AIPS++
Table of Contents -- Index -- PS reprint -- PDF reprint

Astronomical Data Analysis Software and Systems VII
ASP Conference Series, Vol. 145, 1998
Editors: R. Albrecht, R. N. Hook and H. A. Bushouse

RVSAO 2.0 - A Radial Velocity Package for IRAF

Douglas J. Mink and Michael J. Kurtz
Smithsonian Astrophysical Observatory, Cambridge, MA 02138, Email:



RVSAO 2.0 is the latest release of a package for calculating apparent radial velocities of celestial objects from observed spectral shifts. There are two main tasks in the package, XCSAO and EMSAO. XCSAO cross-correlates the Fourier transform of an object's spectrum against the transforms of a set of template spectra with known spectral shifts to obtain a velocity and error. EMSAO finds emission lines in a spectrum and computes the observed centers, getting individual shifts and errors for each line as well as a single velocity combining all of the lines. Three tasks which are new in this release are SUMSPEC, which combines spectra after shifting them all to a specified redshift, LINESPEC, which creates a spectrum at a specified redshift from a list of rest wavelengths, and BCVCORR, which computes the correction needed to translate the observed radial velocity to one relative to the solar system barycenter. Full documentation of this software, including numerous examples of its use, is on-line at


1. Introduction

The RVSAO IRAF external package was developed at the Smithsonian Astrophysical Observatory to compute redshifts from spectra in as automatic a way as possible. It has been used by several large redshift surveys and is also used for stellar radial velocity work. An earlier version of the XCSAO task, which computes radial velocities by cross-correlating spectra against templates of known redshift, has been described by Kurtz et al. (1992). The EMSAO task, which automatically identifies emission lines in a spectrum and computes their redshift has been described by Mink and Wyatt (1995). Mink and Wyatt (1992) described how these IRAF tasks could be combined to reduce large amounts of data in a pipeline. Both XCSAO and EMSAO have been improved over the years, and new tasks have been added to prepare template spectra for cross-correlation and to compute velocity corrections for data with different header keywords than are used by the Smithsonian's telescopes.

2. Changes in XCSAO

The cross-correlation algorithms in XCSAO have been changed very little over the years, although the optional elimination of high-frequency filtering has been added to enable the use of templates with narrow emission lines. Additional log format options have been added at the request of users.

To totally eliminate the effects of bad night sky subtraction, or to remove other features appearing at known positions in the observed wavelength space of a spectrum, a new feature has been added to both XCSAO and EMSAO. If the parameter fixbad is set to yes, XCSAO replaces sections of the spectrum described in the file designated by the badlines parameter with values interpolated from the ends of the sections. A line list is provided to remove the regions around night sky emission lines.

To conform with IRAF conventions for multispec files, that is spectrum files with multiple spectra from multiple apertures, new parameters specband and tempband have been added to specify the band to be read from each aperture. For example, in standard multispec files, band 1 is the object spectrum and band 3 is the sky spectrum. The specnum and tempnum parameters, which could specify either the band or the aperture, now specify only the aperture to be used from the file.

3. EMSAO Line Fitting Improves

The major change in the EMSAO task has been to replace the old minimization routine with one which has been used in a different astronomical context to fit multiple Gaussians. It is both faster and more robust than the old subroutine, making it practical to routinely run EMSAO on every spectrum, whether it has emission lines or not. There is always a danger of getting false emission lines, so it is safest to run EMSAO on spectra against which an emission line template has correlated well in XCSAO.

The sky spectrum, which is used to get the observed noise for better error calculations, may come from a different band skyband of a spectrum, such as the subtracted sky of an apextracted multispec spectrum, as well as from a separate aperture.

Many parameters which were built-in constants have been turned into task parameters. mincont sets a minimum continuum level at which an equivalent width is computed. There are many criteria for whether lines should be kept once they have been fitted. The lwmin and lwmax parameters set the minimum and maximum variation from the mean line width allowed for a line to be accepted. lsmin is the minimum ratio of the equivalent width (or area) to its error for a line to be accepted. A number is now appended to the line rejection flag in tables of results to indicate why the line was dropped.

4. Creating Templates from Line Lists with LINESPEC

By cross-correlating both emission and absorption line objects with XCSAO, a single output line can give both a reasonable redshift and a characterization of the object. Since every emission line object is different, a pure emission line template, with idealized line profiles seemed optimum. LINESPEC was written to use the line profile information provided by a reporting format added to EMSAO to create a spectrum from mean profiles of various identified emission lines.

For each line, the center wavelength in Angstroms, the half-width in Angstroms if positive, in km/sec if negative, the height of line in arbitrary units, and the name of line for labeling, are read from a file. For each line in the table, the center is redshifted accordingly by a z (delta lambda / lambda) or apparent Doppler shifting velocity. The linewidth, if it is tabulated in kilometers per second, is converted to Angstroms at the shifted line center. The line width is also broadened appropriately if the line is redshifted. For each line, a Gaussian at the shifted center wavelength, half-width, and tabulated height is added to the spectrum. After all of the lines are computed, a constant continuum level may be added to the spectrum.

The computed spectrum is displayed, as shown in Figure 1, and may be edited before it is written to a disk file. The header of the output spectrum image includes one parameter per emission line with a vector of line characteristics in the format used by EMSAO.

Figure 1: This is an artificial emission line spectrum created by LINESPEC for SAO's FAST Spectrograph

5. Adding Spectra with SUMSPEC

For a long time, SAO has been using composite absorption line spectra as templates for galaxy cross-correlation. To formalize the process of creating such template spectra, SUMSPEC was written. It combines spectra, shifting them to a common redshift. The VELOCITY header parameter of each of these spectra is assumed to be a solar-system-barycenter-corrected velocity, and a barycentric correction (computed by sumtemp or extracted from the BCV or HCV header parameter) is subtracted to get the actual redshift of the spectrum. Each spectrum is shifted and rebinned to the desired wavelength range and bin size, which may be linear in wavelength or in log-wavelength, then added to the summed template. Input may be multispec or twodspec format, but output is always a one-dimensional file. If the desired output velocity is set to INDEF, spectra are redshifted to the solar system barycentric frame so spectra of the same object observed at different times throughout the year may be added to improve signal to noise.

SUMSPEC can automatically find the wavelength range over which all of the spectra to be added overlap. The output binsize may be specified explicitly or computed from the desired number of pixels and wavelength range. The continuum may be subtracted or divided from each spectrum before it is added into the final composite spectrum.

The composite spectrum may include a list of all of the input spectra in its header, so re-creation is possible. This can be turned off if hundreds of spectra are being added together.

6. More Options for Computing Heliocentric Velocity Correction

The XCSAO, EMSAO, and SUMSPEC tasks compute the velocity change needed to correct the observed redshift to the redshift relative to the sun, or more accurately, the solar system barycenter. They read the time of observation, object position, and observatory position from the spectrum image header. Although these tasks check several commonly-used alternative keywords for most of the needed parameters, it is possible that it won't find all of them. A separate task, BCVCORR, has been added to RVSAO to allow several alternate ways of specifying these three major pieces of information. BCVCORR can write its result to the header of the image which it is processing; the other RVSAO tasks will use this value when their svel_corr parameter is set to ``file".

7. RVSAO's Future

RVSAO will continue to change to meet the needs of astronomers for fast extraction of radial velocities from large numbers of spectra. While RVSAO is ready for current multiaperture and multiple-order spectrographs, new instrumentation will surely require modifications to this software in the future.


Kurtz, M.J., Mink, D.J., Wyatt, W.F., Fabricant, D.G., Torres, G., Kriss, G, and Tonry, J.L. 1992, in Astronomical Data Analysis Software and Systems I, ASP Conf. Ser., Vol. 25, eds. D.M. Worral, C. Biemesderfer, and J. Barnes, 432.

Mink, D.J. and Wyatt, W.F. 1992, in Astronomical Data Analysis Software and Systems I, ASP Conf. Ser., Vol. 25, eds. D.M. Worral, C. Biemesderfer, and J. Barnes, 439.

Mink, D.J. and Wyatt, W.F. 1995, in Astronomical Data Analysis Software and Systems IV, ASP Conf. Ser., Vol. 77, eds. R.A. Shaw, H.E. Payne, and J.J.E. Hayes, 496.

© Copyright 1998 Astronomical Society of the Pacific, 390 Ashton Avenue, San Francisco, California 94112, USA

Next: New Developments in the FITSIO and Fv Software Packages
Up: Applications
Previous: Robust, Realtime Bandpass Removal for the HI Parkes All Sky Survey Project using AIPS++
Table of Contents -- Index -- PS reprint -- PDF reprint