STScI Logo

rspectext onedspec


NAME · USAGE · PARAMETERS · DESCRIPTION · EXAMPLES · REVISIONS
SEE_ALSO

NAME

rspectext -- convert 1D ascii text spectra to IRAF image spectra

USAGE

rspectext input output

PARAMETERS

input
Input list of ascii text spectra. These may have a optional FITS header at the beginning and then two columns of wavelength and flux.
output
Output list of IRAF spectra image names. The list must match the input list.

The following parameters are only used if there is no FITS header with the data.

title = ""
Title to be assigned to the spectra.
flux = no
Are the flux values flux calibrated? If so then header keywords are inserted to identify this for the IRAF spectral software.
dtype = "linear" (none|linear|log|nonlinear|interp)
Type of dispersion to assign to the spectra. The options are:
none
No dispersion function and nothing is added to the image header.
linear
Store the linear dispersion parameters crval1 and cdelt1 in the image header. The wavelength values are ignored. This may be used if the wavlength values are known to be linear but one wants to avoid possible roundoff and resampling errors introduced by the "interp" option.
log
Store the log-linear dispersion parameters crval1 and cdelt1 in the image header. The wavelength values are ignored. This may be used if the wavlength values are known to be linear in the log of the wavelength but one wants to avoid possible roundoff and resampling errors introduced by the "interp" option.
nonlinear
Store the wavelength values in the image header as a lookup table. The flux values are not resampled. The wavelength values need not be evenly sampled.
interp
Use the wavelength values to resample to a linear dispersion between the first and last wavelength values. The dispersion per pixel is determined by the number of pixels and the endpoint wavelengths.
crval= 1., cdelt1 = 1.
The wavelength coordinate of the first pixel and the wavelength interval per pixel to be used with the linear and log dispersion types.

DESCRIPTION

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.

EXAMPLES

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

REVISIONS

RSPECTEXT V2.11
The task now automatically senses the presence of a header.
RSPECTEXT V2.10.3
This is a new task with this version.

SEE ALSO

wspectext, rtextimage, dispcor, mkms, imspec, sinterp


Source Code · Search Form · STSDAS