| rspectext | onedspec | rspectext |
rspectext -- convert 1D ascii text spectra to IRAF image spectra
rspectext input output
The following parameters are only used if there is no FITS header with the data.
Ascii text files consisting of an optional FITS header (usually produced by wspectext ) and a two column list of wavelengths and fluxes are converted to IRAF image spectra. If a header is included then the header information is assumed to describe the spectra including any dispersion function. If no header is given then the minimal information for describing spectra in IRAF is added. The dispersion function can be set either a linear or log-linear based on two keywords (ignoring the wavelength values) or from the wavelength values. The latter may be stored in the header as a lookup table allowing for nonlinear dispersions or resample to a linear dispersion. This task is a script based on rtextimage for the creating the image and entering the flux values, hedit to set some of the header keywords, and dispcor to handle the nonlinear or resampled dispersion functions.
1. Create spectrum from a text file originally produced by wspectext .
cl> type text001
BITPIX = 8 / 8-bit ASCII characters
NAXIS = 1 / Number of Image Dimensions
NAXIS1 = 100 / Length of axis
ORIGIN = 'NOAO-IRAF: WTEXTIMAGE' /
IRAF-MAX= 0. / Max image pixel (out of date)
IRAF-MIN= 0. / Min image pixel (out of date)
IRAF-B/P= 32 / Image bits per pixel
IRAFTYPE= 'REAL FLOATING ' / Image datatype
OBJECT = 'TITLE ' /
FILENAME= 'TEST ' / IRAF filename
FORMAT = '5G14.7 ' / Text line format
APNUM1 = '1 1 '
DC-FLAG = 0
WCSDIM = 1
CTYPE1 = 'LINEAR '
CRVAL1 = 4000.
CRPIX1 = 1.
CDELT1 = 10.1010101010101
CD1_1 = 10.1010101010101
LTM1_1 = 1.
WAT0_001= 'system=equispec '
WAT1_001= 'wtype=linear label=Wavelength units=Angstroms '
END
4000.00 1000.
4010.10 1005.54
4020.20 1011.05
...
cl> rspectext text001 spec001
2. Create a spectrum with a nonlinear dispersion using the wavelength values as a lookup table.
cl> type text002
4000.00 1000.
4010.10 1005.54
4020.20 1011.05
...
cl> rspectext text002 spec002 title="HH12" dtype=nonlinear
wspectext, rtextimage, dispcor, mkms, imspec, sinterp