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 slitmask on the sky, or by errors in object positions.
USAGE | extract-2dspec -f framename -m mapfile
| ||||||||||||||||||||||||||||||
INPUT |
| ||||||||||||||||||||||||||||||
OUTPUT | framename_2spec.fits
| ||||||||||||||||||||||||||||||
PARAMETERS |
|
Data can be extracted in either linear or logarithmic intervals, depending on
the value of the parameter sampling
. If logarithmic, deltalambda
is automatically converted to the sampling interval of base 10 logarithm in wavelength.
If minlambda
and maxlambda
are both set to 0, extract-2dspec uses the values
from the map file.
If edge
is set to a positive value, the spectrum is trimmed by edge
pixels at
the top and bottom of the slit. If edge
is negative, extra pixels are extracted
beyond the nominal ends of the slit.
The header of the first spectrum contains the following parameters:
SHUFFLED = does data included shuffled region? NOD = nod distance, in pixels (for N&S data) D_SLIT = interval along slit, in arc seconds N_SLITS = number of slits extracted EXPTIME = total exposure time of the spectrum
The headers of all spectra contain the following parameters:
DISPAXIS CTYPE1 CTYPE2 WAT0_001 WAT1_001 WAT2_001 CRVAL1 = wavelength of first pixel CDELT1 = wavelength interval of pixels CD1_1 = wavelength interval of pixels CRPIX1 = starting pixel DC-FLAG SLITLEN = slit length, in pixels SLITTYPE 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
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.
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 slitmask 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-2dsepec can,
optionally, correct for some or all of these errors if the parameter search
has
a non-zero value.
trace
is set to "star" or "object", an interval of search pixels above and below the expected spectrum location of all objects of the specified type plus the value of init_off
is searched for the peak of the spectrum trace, the slit position as a function of wavelength is fit to a polynomial of order trace_order
, and the data and fit plotted to the screen. Each trace fit can be accepted or rejected; all accepted traces are used to determine a mean curve of slit displacement vs wavelength, which is used to correct all spectra. Note that this curve is normalized to zero offset: only the shape of the trace is altered by this step, not its mean location along the slit.
align
is not set to "none", an offset of the spectra along the slit is calculated (after correcting for spectrum curvature) and applied to each object, using a method which depends on the value of the parameter align
:
align
= "star_ave": the average offset of the alignment stars is used
align
= "obj_ave": the average offset of the brightest obj_frac
fraction of the objects is used.
align
= "both_ave": the average offset of the alignment stars and the brightest obj_frac
fraction of the objects is used.
align
= "obj_each": the offset of each object is calculated individually and applied.
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_obj_each
method depends on adequate
signal for each spectrum. Although the method used is fairly robust, it cannot
align spectra with insufficient signal. Using objects for the spectrum
curvature determination is recommended only if there are insufficient alignment
stars and the objects are few and adequately bright.