AUGUST 1, 2017

August 2017 STAN

This STAN describes various updates to STIS calibration, including the geometric distortion, time dependent sensitivity, echelle blaze function, and the cosmic ray rejection algorithm.

Different OCRREJECT Versions Yield Different Results

The OCRREJECT routine generates cosmic ray rejected images, given a set of exposures of the same target. This article is to inform users that the HSTCAL version of OCRREJECT used by IRAF/PyRAF contains a bug and yields incorrect results. In fact, the IRAF/PyRAF version is no longer supported, so using this version may adversely affect some datasets. The STIS team recommends using the version of OCRREJECT contained in the Python stistools package.

The STIS Team is currently investigating possible reasons for the discrepancy between the IRAF/PyRAF and stistools versions of OCRREJECT. We will inform users once a solution has been identified and implemented. In the meantime, using the version of OCRREJECT in stistools to correct data from cosmic rays is the recommended course of action.

In order to access stistools, we highly recommend installing AstroConda. AstroConda is the Conda channel maintained by the Space Telescope Science Institute. It contains the tools to reduce data from all HST instruments as well as data from JWST instruments. More information about Conda can be found in the Conda Documentation and a step-by-step guide to installing AstroConda can be found at AstroConda Documentation.

After installing AstroConda and activating the environment, the commands to import and run the OCRREJECT version contained in stistools are as follows:

>>> import stistools

>>> stistools.ocrreject.ocrreject(‘input_file.fits’, ‘output_file.fits’)

If you encounter issues when using these tools, please contact


TDS Reference File Updates


New time dependent sensitivity reference files (TDSTAB) were delivered on March 10, 2017, replacing the reference files that have been in place since 2009. These files are used during the flux calibration step of CALSTIS to correct for both the time-varying changes in the sensitivity of the individual STIS spectral elements as well as the temperature-varying sensitivities of each detector. All non-PRISM spectroscopic observations taken after May 01, 2009 have been reprocessed with these new reference files. The improvements of these new files on the final flux calibration range from modest (<2-3%) to significant (~8%) depending on the wavelength and time of observation. Users working at the shortest wavelengths who are interested in absolute flux calibrations should ensure they are working with data processed with these new files, especially if their observations were taken within the last few years.


The sensitivities of all of the available spectral modes on STIS are currently degrading with time, a process that is thought to be the result of a slow accumulation of hydrocarbons on optical surfaces. The rate of change in the sensitivity is wavelength dependent, and the rate of change itself also varies. These changes are monitored by observing standard stars with the five low resolution gratings (L-modes) on STIS. Each spectrum is divided up into smaller wavelength bins of 50-400 Angstroms in width, covering the full spectral range. The count rates in each wavelength bin as a function of time are fit with a segmented line model, and the slopes and breakpoints of the line segments are recorded in the reference files. Generally, the sensitivities at the shortest wavelengths show the largest changes in sensitivity and more rate changes (i.e., both steeper slopes and more breakpoints) than the longer wavelengths. The figure below shows the change in the TDS correction as a function of wavelength for an observation taken in mid-2017. Most changes are < 3%, but the most extreme changes (up to 8%) are seen in the shortest wavelength bins of each of the ultraviolet gratings.

change in tds as a function of wavelength.
Figure 1. The percent change in the time-dependent sensitivity correction between the previous reference files and the newly delivered ones, evaluated for an observation taken in mid-2017. The change is shown as a function of the wavelength bins where the TDS is measured.

The higher resolution gratings of STIS (first order M-modes and all echelle modes) adopt the L-mode TDS relationships of the closest matching wavelength bin. Limited monitoring of the TDS in a selection of the higher resolution gratings allows us to monitor the appropriateness of this strategy. Generally, we find that it works well. The one exception is for the G430M grating at the 3165 cenwave, for which we find that the sensitivity is degrading more rapidly than the corresponding wavelength bin in the G430L mode. The absolute flux calibration of this mode may be systematically low by 2-3% at present.

The new reference files also contain small updates to the temperature-dependent sensitivities.

Users can check whether they are using the new reference files by inspecting the "TDSTAB" keyword in the primary headers of either the raw or final data products to see if it is set to either 13a1941eo_tds.fits, 13a1941fo_tds.fits, or 13a1941go_tds.fits. The "FLUXCORR" keyword must also be listed as "PERFORM" (in the raw header) or "COMPLETE" (in the processed file header).

The simplest way to attain the newly processed data is to reretrieve the final data products from the MAST data archive. Users may also correct their data themselves by updating their local cache of reference files from the HST Calibration Reference Data System (CRDS) and using the command line tool to automatically assign the best references to the data headers of the raw and wav files. The raw data (both raw and wav files) can then be rerun through the CALSTIS pipeline using the following commands from the Python stistools package:

>>> import stistools

>>> stistools.calstis.calstis('filename_raw.fits')

If you encounter issues when using these tools, please contact


FUV-MAMA Geometric Distortion Correction

On July 7, 2017, the STIS team delivered an updated IDCTAB reference file that corrects geometric distortions for images obtained with FUV-MAMA. This new IDCTAB supersedes older versions, and is currently being applied to all images taken on or after August 2009 with the STIS FUV-MAMA in ACCUM mode. This article provides details on how to manually correct for geometric distortions on images obtained before August 2009. Please note that this IDCTAB update only applies to STIS FUV-MAMA data obtained in imaging mode.

As part of the Calstis (STIS calibration process), geometric distortion corrections are carried out when GEOCORR is set to PERFORM for images obtained with STIS detectors. Calstis takes the flat-fielded science images (_flt.fits) and outputs the geometrically-corrected images (_x2d.fits). However, geometric distortion corrections for STIS FUV-MAMA have not been fully implemented so far due to the lack of reliable distortion solutions. The STIS team has recently derived a new geometric distortion solution for STIS FUV-MAMA imaging data, and the new IDCTAB now implements this solution.

For deriving the new geometric distortion solution, positions of stars in 89 FUV-MAMA observations of NGC 6681 were compared to the astrometric standard catalog created using WFC3/UVIS imaging data to derive a fourth-order polynomial solution that transforms raw (X, Y) positions to geometrically-corrected (X, Y) positions. When compared to astrometric catalog positions, the measured FUV-MAMA positions based on the old IDCTAB showed residuals with an RMS of ~30 mas in each coordinate. Using the new IDCTAB, the RMS is reduced to ~4 mas, or 0.16 FUV-MAMA pixels, in each coordinate. The figure below is a plot of residual FUV-MAMA positions (raw positions minus catalog positions) with the new geometric distortion correction (red) and without a geometric distortion correction (grey). Units are in STIS FUV-MAMA low-resolution pixels, where 1 pixel is equivalent to 25 mas.

pixel based distortion
Figure 1.

The MAST archive already includes geometrically-corrected images (_x2d.fits) using the new IDCTAB for STIS FUV-MAMA images obtained after August 2009. For users needing to manually apply geometric distortion corrections for data obtained before this date, please follow the steps below. In the example below, the flat_fielded file is named o1234567q_flt.fits.

  • Download the IDCTAB from the following link:

  • Change the header parameter for keyword IDCTAB of the o1234567q_flt.fits image to this downloaded file. If the downloaded IDCTAB file is located in the same directory as the o1234567q_flt.fits image, the header should look like:


    IDCTAB = './1771408ro_idc.fits'
  • Verify that the header keyword GEOCORR is set to PERFORM.
  • Run calstis on the o1234567q_flt.fits image. This will create the geometrically-corrected image o1234567q_flt_x2d.fits. In astroconda, running calstis will look like below:


    >>> import stistools
    >>> stistools.calstis.calstis('o1234567q_flt.fits')


If you encounter issues when applying this correction, please contact


Echelle Blaze Function/FUV PHOTTAB Update

An updated STIS FUV spectroscopic photometric conversion reference file (PHOTTAB) was delivered to the HST data pipeline on May 24, 2017. The new PHOTTAB contains updates to the time component coefficients of the echelle blaze function shifts for the E140H grating modes, for observations obtained after STIS’s repair in Servicing Mission 4 (SM4) in 2009. This file improves the relative flux accuracy of recent E140H grating observations in overlapping spectral regions of adjacent spectral orders by up to ~5-10%.

STIS echelle observations include simultaneous coverage of multiple spectral orders to provide overlapping and continuous coverage in the FUV and NUV. The spectral blaze function, or characteristic efficiency of each spectral order, needs to be defined before combining all spectral orders of an observation into a single, continuous flux-calibrated spectrum over the full spectral range. Flux calibration of the STIS echelle modes in the CALSTIS pipeline makes use of on-orbit sensitivity curves for each spectral order of a grating/cenwave combination, derived from observations of a spectrophotometric standard white dwarf. The blaze function is impacted by shifts on the detectors and shape variations over time that are due to changes in the angle of incident light on the gratings. These shifts and variations can lead to flux mismatches of up to ~5-10% in overlapping spectral regions of adjacent orders when left uncorrected (see Figure 1).

phottab before correction
Figure 1. A composite spectrum of subdwarf BD+28◦4211 taken with the E140H/1416 grating setting, which demonstrates the error in flux calibration without the time-dependence of the blaze shift applied.

The blaze function shift is calculated as a function of spatial location on the detector in the x- and y-directions, and as a function of observation date. After SM4 the time coefficients of the blaze shift were set to zero when new sensitivity curves were derived. Since then, the time dependence of the blaze shift was not corrected for in the CALSTIS pipeline. New time coefficients have been derived for all eleven E140H cenwaves in the new FUV-MAMA PHOTTAB file, 15o1440ro_pht.fits. The average relative flux agreement for overlapping spectral regions with the updated reference file is within our relative photometric flux accuracy requirement of 5% (STIS Instrument Handbook, Table 16.2), for greater than 75% of post-SM4 data sets for all E140H cenwaves. An example of the improvement in the relative flux accuracy is shown in Figure 2.

phottab after correction
Figure 2. Same composite spectrum as shown in Fig. 1, after applying the new time-dependent blaze function shift coefficients in the updated PHOTTAB reference file.

Post-SM4 E140H observations retrieved from the MAST archive after May 25, 2017, have been processed with the new PHOTTAB reference file. Users may wish to re-retrieve their data again from MAST for the most up-to-date calibrated version, or download a copy of the new reference file to manually reprocess their observations. The new reference file may be obtained at the following page:

New time coefficients for the other three STIS echelle gratings, E140M, E230M, and E230H, have also been derived and are currently being tested. PHOTTAB updates for each grating will be released separately, later this year.


Please Contact the HST Help Desk with any Questions