extract-2dspec

extract-2dspec uses a map file to extract 2-dimensional spectra from a set of image files. Spectra are extracted onto a rectangular array of wavelength and slit position. Output data are stored as a set of image extensions in a 3-dimensional fits file, one spectrum per extension The 3-d file consists of two planes, the first of which is the spectrum, and the second of which contains the 1-sigma errors of the spectrum, pixel by pixel. extract-2dspec automatically handles nod&shuffle data.
extract-2dspec can, optionally, search for and correct for offsets in the positions of spectra caused by misalignment of the slit mask on the sky, or by errors in  object positions.

USAGE
extract-2dspec  -f framename -m mapfile
INPUT
framename  is a set of image files from which the spectra are extracted
mapfil
e
       is the map file which applies
OUTPUT
framename_2spec.fits
PARAMETERS
deltalambda
wavelength interval of extracted spectrum
deltaslit
slitposition interval of extracted spectrum, in arc sec
minlambda
minimum wavelength of extracted spectrum
maxlambda
maximum wavelength of extracted spectrum
telscale
telescope scale arc sec/mm
search
half-width of spectrum search region, in pixels
star_trace trace alignment star spectra?
trace_order order of fit to star spectrum trace
align alignment method: "none", "star_ave", "obj_ave",  or "obj_each"
obj_frac brightest fraction of objects used in obj_ave alignment method
init_off initial spectrum offset
sub_ns subtract shuffled region of N&S data?
sampling sampling interval type; "linear" or "log"
use_holes extract alignment stars as well as objects?


Details:

Data can be extracted in either linear or logarithmic intervals, depending on the value of the parameter sampling. If logarithmic, deltalambda is the  sampling interval in log10 lambda.

if minlambda and maxlambda are both set to 0, extract-2dspec uses the values from the map file.

The header of the first spectrum contains the following parameters:

N_SLITS = number of slits extracted
D_SLIT   =  interval along slit, in arc seconds
CRVAL1 = wavelength of first pixel
CDELT1 =  wavelength interval of pixels
EXPTIME = total exposure time of the spectrum
SHUFFLED = does data included shuffled region?
NOD = nod distance, in pixels (for N&S data)

The headers of all spectra contain the following parameters:

CNTRLINE = the line in the 2-d spectrum centered on the object
OBJECT      = object name, as defined in the SMF file for the mask
SLITNUM   =  slit number in SMF file for the mask
SLITLEN = slit length, in pixels

Nod & shuffle data:

The shuffle region is extracted along with the primary slit region. If sub_ns is set to yes, it is then subtracted from the primary slit data. This should be done if multiple 2-d spectra are to be combined later, with cosmic ray removal, using sumspec.

Correcting for positional errors

The spectral map accurately predicts the loci of slit position and wavelength,  but there may still be errors in the positions of objects along the slits, due to (1) errors in the alignment of the slit mask with the sky (2) errors in the positions of objects in the SMF catalog, (3) displacement of the spectrum along the slit with wavelength, due to atmospheric refraction. extract-2dspec can, optionally, correct for some or all of these errors if the parameter search has a non-zero value.

It is recommended that the star trace method at least be tried for all data unless the alignment star data is inadequate; if there is no clear mean curvature of the spectra, application of the trace correction can be rejected. It is also recommended that at least the star_ave or obj_ave displacement correction be used. Particularly if many exposures are later to be added together using sumspec with cosmic ray rejection, it is important the the spectra be well-aligned.  The use of the obj_each method depends on adequate signal for each spectrum. Although the method used is fairly robust, it cannot align spectra with insufficient signal.

Back to programs