ocrreject¶
Add STIS exposures, rejecting cosmic rays.
Examples¶
In Python without TEAL:
>>> import stistools
>>> stistools.ocrreject.ocrreject("o3tt02020_flt.fits",
... "o3tt02020_crj.fits", verbose=True, trailer="o3tt02020.trl")
In Python with TEAL:
>>> from stistools import ocrreject
>>> from stsci.tools import teal
>>> teal.teal("ocrreject")
From command line:
% ./ocrreject.py -v -s o3tt02020_flt.fits o3tt02020_crj.fits
% ./ocrreject.py -r
- stistools.ocrreject.getHelpAsString(fulldoc=True)¶
Return documentation on the ocrreject function.
- stistools.ocrreject.main(args)¶
- stistools.ocrreject.ocrreject(input, output, all=True, crrejtab='', scalense='', initgues='', skysub='', crsigmas='', crradius=None, crthresh=None, badinpdq=None, crmask='', verbose=False, timestamps=False, trailer='', print_version=False, print_revision=False)¶
Find and reject cosmic rays in STIS data.
- Parameters:
- input: str
Name of the input file or files.
- output: str
Name of the output file. See all for further information.
- all: bool
If True (the default), combine all input files into one output file. In this case, output should just be one file name. If False, the number of input and output file names must be the same.
- crrejtab: str
This argument may be used to override the CRREJTAB value in the primary headers of the input files.
- scalense: str
If specified, this overrides SCALENSE in the CRREJTAB.
- initgues: str
If specified, this overrides INITGUES in the CRREJTAB. The allowed values are "min" and "med" and "".
- skysub: str
If specified, this overrides SKYSUB in the CRREJTAB. The allowed values are "none", "mode" and "".
- crsigmas: str
If specified, this overrides CRSIGMAS in the CRREJTAB. The value should be a comma-separated string of one or more integer or float values. For each such value, calstis will perform one cosmic-ray-rejection cycle, with the sigma taken from the numerical value that was specified.
- crradius: float or None
If not None, this overrides CRRADIUS in the CRREJTAB. This is the rejection propagation radius in pixels (e.g. 1.5). After finding an outlier (a cosmic ray hit), adjacent pixels can also be flagged and excluded. Neighboring pixels will be rejected if their values are discrepant by more than crthresh * sigmas * noise, where noise is based on the noise model (i.e. Poisson noise and readout noise).
- crthresh: float or None
If not None, this overrides CRTHRESH in the CRREJTAB. This is the rejection propagation threshold (e.g. 0.8). If crthresh = 0 then all adjacent pixels (see crradius) will be rejected.
- badinpdq: int or None
If specified, this overrides BADINPDQ in the CRREJTAB. This is a data quality flag (or bitwise OR of flags) to allow rejection of pixels in the input images when forming the "guess" image (the image with which to compare the input images when looking for outliers).
- crmask: str
If specified, this overrides CRMASK in the CRREJTAB. crmask = "yes" means that the cosmic rays that are detected should be flagged in the DQ (data quality) extensions of the input files.
- 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 cs2.e (the calstis host executable) returned a non-zero status. If verbose is True, the value returned by cs2.e will be printed.
- stistools.ocrreject.prtOptions()¶
Print a list of command-line options and arguments.
- stistools.ocrreject.run(configobj=None)¶
TEAL interface for the ocrreject function.