x2d¶
Rectify 2-D STIS spectral data.
Examples¶
In Python without TEAL:
>>> import stistools
>>> stistools.x2d.x2d("o66p01020_flt.fits", output="test_x2d.fits",
... verbose=True, trailer="o66p01020.trl")
In Python with TEAL:
>>> from stistools import x2d
>>> from stsci.tools import teal
>>> teal.teal("x2d")
From command line:
% ./x2d.py -v o66p01020_flt.fits o66p01020_x2d.fits
% ./x2d.py -r
- stistools.x2d.getHelpAsString(fulldoc=True)¶
Return documentation on the x2d function.
- stistools.x2d.main(args)¶
- stistools.x2d.prtOptions()¶
Print a list of command-line options and arguments.
- stistools.x2d.run(configobj=None)¶
TEAL interface for the x2d function.
- stistools.x2d.x2d(input, output='', helcorr='perform', fluxcorr='perform', statflag=True, center=False, blazeshift=None, err_alg='wgt_var', verbose=False, timestamps=False, trailer='', print_version=False, print_revision=False)¶
Rectify 2-D STIS spectral data.
- Parameters:
- input: str
Name of the input raw file.
- output: str
Name of the output file, or "" (the default). If no name was specified, the output name will be constructed from the input name.
- helcorr: str
If "perform", correct for heliocentric Doppler shift.
- fluxcorr: str
If "perform", convert to absolute flux.
- statflag: bool
If True, compute statistics for image arrays and update keywords.
- center: bool
If True, center the target spectrum in the cross-dispersion direction. For G140L and G140M spectra, the target has at different times been offset to a location either above or below the middle of the detector, to avoid the repeller wire. This argument allows more convenient comparison of data taken at widely different times.
- blazeshift: float or None
Blaze shift (in pixels). None means blazeshift is not specified.
- err_alg: str
Algorithm for computing error estimates. The default is "wgt_var", which means that the weight (for bilinear interpolation) is applied to the variances of the input pixels. The alternative is "wgt_err", to specify that the weight should be applied to the errors of the input pixels.
- verbose: bool
If True, calstis will print more info.
- timestamps: bool
If True, calstis will print the date and time at various points during processing.
- trailer: str
If specified, the standard output and standard error will be written to this file instead of to the terminal. Note, however, that if print_version or print_revision is specified, the value will be printed to the terminal, and any name given for the trailer will be ignored.
- print_version: bool
If True, calstis will print the version number (a string) and then return 0.
- print_revision: bool
If True, calstis will print the full version string and then return 0.
- Returns:
- status: int
0 is OK. 1 is returned if cs7.e (the calstis host executable) returned a non-zero status. If verbose is True, the value returned by cs7.e will be printed. 2 is returned if the specified input file or files were not found, or the numbers of input and output files (if the latter was specified) are not the same.