extract-spec uses a map file to extract 1 or 2-dimensional spectra from a set of 1 or 8 image files. In either case, spectra are first resampled onto a rectangular array of wavelength and slit position. The 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. The output flux units are counts per angstrom-arc sec (along slit). If 1-d extraction is specified, an optimal extraction is performed on each 2-d spectrum, and the resulting spectra- cleaned of cosmic rays- are also stored as a set of 3-d image extensions, one per spectrum. Each plane- for spectrum and errors- is one pixel wide. The output flux units are counts per angstrom.
extract-spec automatically handles nod&shuffle data. extract-spec can, optionally, search for and correct for offsets in the positions of spectra caused by misalignment of the slitmask on the sky, errors in object positions, and atmospheric dispersion.
USAGE |
|
||||||||||||||||||||||||||||||||||
INPUT |
|
||||||||||||||||||||||||||||||||||
OUTPUT |
|
||||||||||||||||||||||||||||||||||
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
SLITTYPE
OBJECT = object name, as defined in the SMF file for the mask
SLITNUM = slit number in SMF file for the mask
2-d spectra contain the following additional lines
SLITLEN = slit length, in pixels
CNTRLINE = the line in the 2-d spectrum centered on the object
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,
and is done by default if 1-d extraction is specified.
A properly adjusted 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, or (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.
1-d extraction
1-d extraction uses the optimal extraction method described in Horne (1986). Cosmic rays are automatically removed. One may use the entire length of the slit, but- if the total size of the objects is much smaller than the slit length, or if one is not interested in preserving the spectrophotometric information in the spectrum- noise can be somewhat reduced by setting a smaller extraction region using the parameter hwidth. If the spectra are bad near the slit ends, it is recommended to either use a smaller value of hwidth, or set the edge parameter to exclude the bad ends. If this entry is left blank, or set to a size larger than the half-length of the longest slit, the entire slit length is used. Positional error correction, as described above, is not needed if the entire slit length is used, but is advisable if a narrow extraction region is used.
If the spectra are quite weak on a single exposure, but multiple exposures are available, it may be preferable to first combine and CR-clean the 2-d spectra with sumspec, then do the 1-d extraction using the routine 1dspec.