3.5 Manual Recalibration of WFC3 Data
3.5.1 Requirements for Manual Recalibration
Retrieving Software and Input Data Files
Data retrieved from MAST (Barbara A. Mikulski Archive for Space Telescopes), via the Portal or the search form, will have been processed with the most up-to-date calibration reference files and software. Nevertheless, some users may wish to reprocess existing WFC3 observations with e.g. alternative reference files. To do so, the following must be available on their system:
- Software for data processing (distributed in the Astroconda package)
- Reference files may be obtained from CRDS, as described in Section 3.1.4.
- Uncalibrated (raw) data files from MAST
- Any association tables that describe observation sets.
Setting the Path to Reference Files
Before any recalibration can be done, the user must define a local directory containing the calibration reference files. For WFC3, this directory is referred to as ‘iref’. The raw image headers already contain the appropriate keywords that list the reference file names that were assigned during STScI pipeline processing. The user must simply define the location of the ‘iref’ directory in their Unix environment:
setenv iref /mydisk/myiref/
If executed from the command line, this setup must be done in the same window in which python will be started. (Setting ‘iref’ from within python will not work, even though subsequently typing ‘show iref’ would suggest it might.) For convenience, this setup command can be added to the '.setenv' file, so that the 'iref' environment variable will always be defined. The ‘iref’ environment variable is required whether reprocessing through python or from the OS command line.
An alternate method of accessing WFC3 reference files is shown in a new python tutorial in Section 3.5.2. In this example, the best WFC3 reference files for a given set of input images are retrieved directly from CRDS and placed in a local 'crds_cache/' directory. The notebook shows how to update the header keywords to point to these new reference files and sets the 'iref' environment variable for subsequent calwf3 processing.
Selecting Calibration Switches
The MAST HST Data Processing uses the most up-to-date calibration reference files by default. In order to use non-default reference files, manual recalibration is required and in this case, the calibration reference file keywords will need to be updated manually in the raw data files with the desired file names before running calwf3. In addition, the user can choose to change which calibration steps are performed by calwf3 by resetting the values of the calibration switch keywords. These keywords are listed in Table 3.7 along with their default values as used in the STScI pipeline. To change the values of any of the keyword switches, a FITS keyword editor such as the python package astropy.io.fits may be used.
from astropy.io import fits
Table 3.7: Calibration switch and default settings.
Perform CTE correction (UVIS)
Data Quality Array Initialization
Zero-read Signal Correction (IR)
CCD Overscan Region Subtraction (UVIS)
Reference Pixel Bias Correction (IR)
Bias Image Subtraction (UVIS)
Post-flash Image Subtraction (UVIS)
UVIS Cosmic Ray Rejection:
IR Cosmic Ray Rejection:
Zero-read Image Subtraction (IR)
Non-linearity Correction (IR)
Dark Image Subtraction
Shutter Shading Correction (UVIS)
Units Conversion (IR)
Photometric normalization of the two UVIS chips
Repeat-Obs Processing (IR)
Full calibration of individual exposures in an association
3.5.2 calwf3 Examples
Documentation for the calwf3 software is provided at readthedocs, with version history available on the STScI github repository or readthedocs software history. Users may reprocess either a single RAW image, an image association, or a list of raw files:
A single RAW exposure
from wfc3tools import calwf3
An image association (ASN)
A list of RAW files (not part of an ASN)
for raws in glob.glob('ibohbf*_raw.fits'):
A new WFC3 notebook tutorial provides calwf3 reprocessing examples to improve calibrated WFC3/IR images affected by time-variable background. The notebook shows how to diagnose images with poor-quality ramp fits and rerun calwf3 with the 'CRCORR' step turned off.
Time-variable background is described in Section 7.10 and is likely caused by Helium I emission in the Earth's atmosphere at 1.083 microns (WFC3 ISR 2014-03). For the imaging filters F105W and F110W, this produces a flat excess signal which is added to the total background for a subset of reads. When strong enough, this non-linear signal may compromise the ramp fitting performed by calwf3, which is designed to flag and remove cosmic rays and saturated reads. The affected calibrated FLT data products will have much larger noise and a distinctly non-gaussian background.
In this tutorial, the images are reprocessed using the 'Last-minus-first' technique described in WFC3 ISR 2016-16. This turns off calwf3's ramp fitting step (CRCORR) and treats the IR detector like a CCD that accumulates charge and is read out only at the end of the exposure. In this case, the observed count rate is determined by simply subtracting the first from the last read of the detector and dividing by the time elapsed between the two reads.
Note: while time-variable background also impacts the IR grisms, the methods used for imaging data should not be used to correct G102 and G141 observations, which are affected by a combination of zodiacal background, helium line emission, and scattered Earth light, each of which vary spatially across the detector. More detail on background corrections for grism data is provided in WFC3 ISR 2020-04.
WFC3 Data Handbook
- • Acknowledgments
- • What's New in This Revision
- Chapter 1: WFC3 Instruments
- Chapter 2: WFC3 Data Structure
- Chapter 3: WFC3 Data Calibration
- Chapter 4: WFC3 Images: Distortion Correction and AstroDrizzle
- Chapter 5: WFC3-UVIS Sources of Error
- Chapter 6: WFC3 UVIS Charge Transfer Efficiency - CTE
Chapter 7: WFC3 IR Sources of Error
- • 7.1 WFC3 IR Error Source Overview
- • 7.2 Gain
- • 7.3 WFC3 IR Bias Correction
- • 7.4 WFC3 Dark Current and Banding
- • 7.5 Blobs
- • 7.6 Detector Nonlinearity Issues
- • 7.7 Count Rate Non-Linearity
- • 7.8 IR Flat Fields
- • 7.9 Pixel Defects and Bad Imaging Regions
- • 7.10 Time-Variable Background
- • 7.11 IR Photometry Errors
- • 7.12 References
- Chapter 8: Persistence in WFC3 IR
- Chapter 9: WFC3 Data Analysis
- Chapter 10: WFC3 Spatial Scan Data