ASP Conference Series, Vol. 101, 1996
George H. Jacoby and Jeannette Barnes, eds.
SPEFO---A Simple, Yet Powerful Program for One-Dimensional Spectra ProcessingPetr Skoda
Astronomical Institute of the Academy of Sciences of the Czech Republic, 25165 Ondrejov, Czech Republic
Abstract:SPEFO is a small, yet powerful program used for processing stellar spectra at the Astronomical Institute of the Academy of Sciences of the Czech Republic in Ondrejov. It was originally written in 1990 by Dr. Jirí Horn for processing spectral plates obtained with the 2m telescope of the Ondrejov observatory and scanned with the local five channel microphotometer. Since then the code had been under constant improvement until the sudden death of the author in December 1994. Currently SPEFO is used mainly for the reduction of data from the Ondrejov Reticon detector (1872 pixels, 12 bit A/D), however it can process data from other instruments too, provided that they are in FITS one-dimensional format.
The code was written in Turbo Pascal for MS-DOS; the size of the binaries is less than 350 KB. SPEFO will run on an ordinary PC computer with very modest hardware demands (PC AT 286, 1 MB RAM, 30 MB HD color EGA or VGA). Despite its small size the program is very powerful, and user friendly as well. The basic data reduction tasks such as derivation of the dispersion function, spectrum rectification, Fourier noise filtering, radial velocity and equivalent width measurements are performed in an easy manner, and the user can immediately see changes to the data on a screen plot (e.g., the line position is determined in the ``oscilloscopic'' mode by finding the coincidence of the displayed line and its interactively shifted mirrored profile, the continuum level spline is recalculated after fixing each new point, etc.).
The main output of SPEFO is a table of radial velocities of measured stellar lines (including the atmospheric line correction), their equivalent widths and higher order moments, relative central line intensities and FWHM, together with the HPGL plot file. The program can do basic operations on spectra like comparison of two spectra, subtraction, adding, production of differential spectra or the transformation by rotational broadening. SPEFO can also deal with synthetic spectra produced from various model stellar atmospheres allowing their comparison with real data and hence determining the physical parameters (, chemical composition) of the star under investigation.
At the beginning of 1990 a new system was commissioned in the stellar department for processing of photographic spectral plates---the five-channel stellar microphotometer. It can simultaneously scan in all five channels---two fog and two comparison spectra on both sides of the stellar one---a spectroscopic plate up to 400 mm long with a step as small as 1 m, the data being digitized by 12 bit A/D conversion. Although driven by an old-fashioned TMS-9900 based microcomputer, it can be controlled through a serial port from an ordinary PC AT computer. At that time our colleague Dr. Jirí Horn decided to write a new spectra reduction program called SPEFO (as SPEctroFOtometry), the microphotometer driving program being embedded in it. After switching from photographic plates to a Reticon 1872F linear detector (in 1993), the SPEFO was upgraded to be capable of processing electronic data produced by the Reticon control software RETICON as well as to do FITS conversion and synthetic spectra investigation.
2. The SPEFO General Overview
The SPEFO is written in Borland Turbo Pascal using its graphic library BGI and it consists of a 75 KB long spefo.exe and a 245 KB overlay spefo.ovr binary. The program is modular with each module solving a particular problem. Each partial step of processing is secured in a file with a characteristic extension, and at the same time the current state of processing is saved in the file's header (e.g., the spectrum after establishing its continuum spline remembers the control points of the polynomial).
Several files must be prepared by hand (in ASCII) before the measurements, to describe the particular type of investigation dependent on the object, personal preferences, etc. In this category belong the list of comparison spectrum lines, the stellar lines under investigation, telluric lines, interstellar ones, etc. The result of the processing of a particular problem is the comprehensive report file as well as the graphic plot of the spectra in HPGL format that may be converted to, e.g., PostScript, and used in publications.
Every action has its prompt and the user is informed each time of what is being done. The data are shown in interactive graphics with the possibility of X,Y zooming, panning, setting of control points (the data are recalculated in real time---so, e.g., you can estimate the continuum spline like the rubber band just by inserting and deleting its control points). A very nice part of the SPEFO is the line position measurement in a manner similar to an oscilloscopic comparator. The enlarged spectral line is shown together with its mirrored profile (in another color) that can be interactively shifted until they match. It is valuable for blended lines for fitting each component, or for asymmetric lines to fit both the wings and the core separately.
3. The SPEFO Basic Functions
The description of SPEFO's basic modules may be divided into the functions related to photographic plate processing, electronic spectra processing and general functions.
3.1. Photographic Plate Processing
- Cal This is the module for establishing the
synthetic calibration of the photographic density curve.
It calls the microphotometer driver
which scans the plate across its dispersion axis to get the
information about photometric wedges and the fog.
Then the on-screen
interactive editor is called, where the mean intensity of both
wedge and fog is set. The same is done for another position on the
After finishing (typically 4--6 perpendicular cuts) the
synthetic calibration curve is displayed (with the possibility of
deleting points with large errors), and polynomial coefficients of
its fit are calculated.
- Star The main part of stellar plate processing. The microphotometer driver scans the plate along the dispersion axis and data from all five channels are written into separate files. After the arc line identifications (see 3.2.) the file containing relative intensities of wavelength-calibrated stellar spectrum (using the particular calibration density curve) is written.
3.2. Electronic Spectra Processing
The basic reduction of data from electronic
detectors is done here. The data from the Ondrejov
observatory Reticon are used directly; data from foreign instruments
(usually CCDs) have to be
one-dimensional and first converted to the SPEFO format. In both cases all types of files are requested---data for bias, flat
field (both may be several averaged), calibration arc (before and after object)
and stellar spectrum are requested.
Then the comparison lines from a particular arc line list are identified interactively in either the oscilloscopic or automatic mode with the chosen polynomial fit order. The wavelength-zoomed comparison lines are displayed and their approximate center position has to be marked by moving a vertical cursor together with their identification number according to the arc line list. Then the enlarged line together with its mirror profile is shown, and it may be interactively shifted until their exact match is reached. After identification of at least three lines the estimate of the dispersion curve fit is calculated, and the other lines may be identified automatically. Badly defined lines may be rejected. After the line list has been exhausted, the dispersion curve is displayed with the possibility of rejecting points with large errors. The result of the processing is the wavelength-calibrated unrectified stellar spectrum.
3.3. General Processing Utilities
- Rect The rectification of the spectrum by
division by a continuum fit spline. The fit is obtained as a rubber
band spline by interactively setting its control points.
- Filt The Fast Fourier filtering of the
rectified spectrum. The power spectrum is shown;
the filter width may be set by moving the edge-cutting line.
- Radial vel
Radial velocities of interesting stellar
lines (described in a stellar line list) are interactively measured in
the oscilloscopic or automatic mode; the heliocentric correction
is taken into account.
- Eq. Widths and Moments The equivalent widths of the stellar
lines are estimated. The enlarged
line profile is shown, and the user is asked to mark the central
intensity by moving the short tic along the profile. Then the
FWHM line is drawn and the equivalent width calculated using the
numerical integration. Similarly,
the higher order moments of lines are
estimated (the equivalent width is the zero order moment).
- Plot One or several spectra are prepared for
the graphical output. Several questions are asked about
the plot dimensions, the continuum level (for each spectrum), the
data file names, the plotted range, etc. These parameters are
written into a parametric file that may be used a second time for
the same plot (but with another data file). The spectral data
are converted to HPGL and written to the file or directly sent to
an HP plotter (up to 8 colors).
- Synt This module is intended especially for the
comparison of observed spectra with the synthetic ones, but
other spectra may be processed as well. The processing includes
the spectra comparison, addition and subtraction.
Two selected files are
shown on screen with the changeable radial velocity and weakening
The synthetic spectrum is described by a simple ASCII table of
wavelength and corresponding line and continuum flux and may be
- File The toolbox of file conversion utilities.
The possible conversions are from the binary
SPEFO format file to an ASCII file and vice versa,
import/export of 1D FITS files and
a tool for viewing or editing of any
rectified SPEFO file on a screen display. Individual points may be
deleted, or the selected part of the spectrum may be replaced
by a linear or spline fit.
SPEFO is considered by its users to be a very powerful program providing the stellar astronomer with all the tools necessary for efficient stellar spectra investigation, from the raw data acquisition and its basic reduction up to the final session protocol and plot, that may be directly included into the published article. It might be a good choice for someone wishing to do his work on a small MSDOS-based PC (e.g., the notebook), as one of SPEFO's outstanding features is its compactness and small size with minimal HW demands.