x1d

Extract 1-D spectrum.

Examples

In Python without TEAL:

>>> import stistools
>>> stistools.x1d.x1d("o66p01020_flt.fits", output="test_x1d.fits",
...                   verbose=True, trailer="o66p01020.trl")

In Python with TEAL:

>>> from stistools import x1d
>>> from stsci.tools import teal
>>> teal.teal("x1d")

From command line:

% ./x1d.py -v o66p01020_flt.fits o66p01020_x1d.fits
% ./x1d.py -r
stistools.x1d.getHelpAsString(fulldoc=True)

Return documentation on the x1d function.

stistools.x1d.main(args)
stistools.x1d.prtOptions()

Print a list of command-line options and arguments.

stistools.x1d.run(configobj=None)

TEAL interface for the x1d function.

stistools.x1d.x1d(input, output='', backcorr='perform', ctecorr='perform', dispcorr='perform', helcorr='perform', fluxcorr='perform', sporder=None, a2center=None, maxsrch=None, globalx=False, extrsize=None, bk1size=None, bk2size=None, bk1offst=None, bk2offst=None, bktilt=None, backord=None, bksmode='median', bksorder=3, blazeshift=None, algorithm='unweighted', xoffset=None, verbose=False, timestamps=False, trailer='', print_version=False, print_revision=False)

Extract a 1-D spectrum from an flt or crj file.

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.

backcorr: str

If "perform", subtract the background.

ctecorr: str

If "perform", apply CTE correction (CCD only).

dispcorr: str

If "perform", compute wavelengths from the dispersion relation.

helcorr: str

If "perform", correct for heliocentric Doppler shift.

fluxcorr: str

If "perform", convert to absolute flux.

sporder: int or None

The number of the spectral order to extract.

a2center: float or None
maxsrch: float or None
globalx: bool

If True, use the global cross correlation offset (i.e. average for all orders) for all spectral orders.

extrsize: float or None

Size of extraction box. None means extrsize is not specified.

bk1size: float or None

Size of first background region. None means bk1size is not specified.

bk2size: float or None

Size of second background region. None means bk2size is not specified.

bk1offst: float or None
Offset of first background region. None means bk1offst is not

specified.

bk2offst: float or None

Offset of first background region. None means bk2offst is not specified.

bktilt: float or None

Background tilt. None means bktilt is not specified.

backord: int or None

Background order (0 or 1). None means backord is not specified.

bksmode: str

Background smoothing mode ("off", "median" (the default), or "average").

bksorder: int

Background smoothing polynomial order (default is 3).

blazeshift: float or None

Blaze shift (in pixels). None means blazeshift is not specified.

algorithm: str

Extraction algorithm ("unweighted" (the default) or "sc2d")

xoffset: float

Offset in X for slitless extraction.

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 cs6.e (the calstis host executable) returned a non-zero status. If verbose is True, the value returned by cs6.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.