5.1 Data Reduction and Analysis Applications
Most of the software tools for operating on STIS FITS files are contained in the stistools package. Stistools is a package that provides Python-based data processing tools for working with STIS data. It contains calstis, the full STIS calibration pipeline, as well as its individual components (e.g., basic2d, ocrreject, wavecal, x1d, x2d). Many of these tasks are described in Chapter 3. In addition, stistools features a selection of analysis tools independent from the pipeline. The following website provides documentation including example usages for individual tasks in the stistools package:
As of early 2019, the transition from older IRAF/PyRAF routines to Python-based routines is still in progress, and there remains a few tools from the IRAF/PyRAF version of the package that are still in development in the Python package. In this transitional period, users are encouraged to use IRAF/PyRAF for the tools/tasks currently unavailable in Python., e.g., tasks for removing IR fringes (see Section 3.5.5). In the meantime, we plan to keep the stistools web documentation up to date, so users are aware of any update to its components.
5.1.1 STIS-Specific Python Tasks
In Chapter 3, we gave detailed discussions of the use of the data reduction pipeline calstis, the calstis component tasks, and auxiliary tasks that were developed to create customized reference files and to facilitate the combination of unassociated images. Most of these tasks are contained in the stistools package. Other tasks useful for reducing and analyzing STIS data are contained in this package as well. A complete listing and brief description of these tasks can be found at https://stistools.readthedocs.io/.
The function stistools.stisnoise was implemented to deal with the increase in pattern noise with the shift of STIS operations to Side-2 electronics in July 2001. The function stistools.mktrace was created to correct the orientation of spectral traces for application to a given image when it was discovered that the traces have gradually rotated over time. (The average rotation rates have been incorporated into the trace reference files for the L gratings and for the most commonly used M modes: G750M (
CENWAVEs 6581, 6768, 8561). See Section 3.5.7.) The function stistools.wx2d is being offered as an alternative to the bilinear interpolation performed by stistools.x2d. It produces an image that is iteratively subsampled in the cross-dispersion direction, then rectified in that dimension and summed back into pixels. The final image can then be processed by stistools.x2d for photometric calibration.
5.1.2 Handling FITS Tables
STIS spectral extractions, TIME-TAG data, and most STIS reference files are stored in FITS tables (see Section 2.3.2 for a description of the structure of the table extension files for spectral extractions and TIME-TAG data). The Table module in astropy.tableis designed to read in data contained in FITS tables. Below, we provide several examples of using the Table module with STIS data files. A sample output is given after each command.
Find out what information is given in the columns of a FITS table (the parameters listed here are discussed in depth in Section 5.4):
To look at the contents of the table:
Note that the number of columns displayed is limited by the width of the window that you are working in when using print(). To see more columns, you can simply adjust the width of the window and rerun the command above. If you want to view specific columns:
Reference file FITS tables generally have many rows, with each row characterizing a specific operating mode, location on the detector, value of a parameter to be used in the reduction, etc. To display specific rows in the table:
5.1.3 General Spectral Display and Analysis Tasks
The astropy package specutils provides a basic interface for loading, manipulating, and common forms of analysis of spectroscopic data. Documentation for specutils can be found at https://specutils.readthedocs.io. SpecViz is an interactive tool for visualization and quick-look analysis of 1-D astronomical spectra written in the Python language. Documentation for SpecViz can be found at https://specviz.readthedocs.io. Note that these packages are currently in active development and may lack some functions for detailed analyses. For these cases, users can utilize the older PyRAF/IRAF/STSDAS applications for displaying and analyzing STIS spectral data. such as those listed in Table 5.1.
Table 5.1: Spectral Analysis Tasks
Plots multiple STIS echelle spectral orders.
2-D & 3-D tables, images
General 1-D feature fitting; part of the STSDAS fitting package.
2-D & 3-D tables, images
General presentation graphics; supports world coordinates.
2-D & 3-D tables, images
General 1-D plotting; supports world coordinates.
General 1-D spectrum modelling package.
General 1-D spectral analysis.
5.1.4 AstroDrizzle for Image Combination
AstroDrizzle is a Python script that automates the detection of cosmic rays and the combination of dithered images. A user guide for DrizzlePac, which includes AstroDrizzle, can be found at http://www.stsci.edu/scientific-community/software/drizzlepac.html.
AstroDrizzle has been adapted to STIS imaging as well as ACS, WFC3, and COS imaging. It can be used to combine STIS CRSPLIT or REPEATOBS image sets as well as dithered images and images made with the same aperture and optical elements but with different target centering or orientation. It uses cosmic ray rejection algorithms which often gives superior results to calstis for CRSPLIT and REPEATOBS exposures, especially for images of unresolved targets with high signal-to-noise.
STIS Data Handbook
- Chapter 1: STIS Overview
- Chapter 2: STIS Data Structure
- Chapter 3: STIS Calibration
- Chapter 4: STIS Error Sources
- Chapter 5: STIS Data Analysis