Introduction
ACS images in all channels (WFC, SBC, and HRC) suffer from extreme geometric distortions due to the tilt of the focal plane (about ~28º) with respect to the incoming beam. This results not only in the characteristic rhomboidal shapes of (distortion-corrected) ACS images but also distortion so large that—if uncorrected—the inferred celestial position of a WFC source can differ by as far as ∼120 pixels (∼6 arcsec) from its true position.
To address this, the geometric distortion is corrected using a 5th order Simple Imaging Polynomial (SIP). The coefficients of the SIP—inferred using least squares—are generally embedded in the FITS header of a given ACS image. For the WFC channel, the first order terms (i.e. scale, skew, shift) of the SIP exhibit strong time-dependence. As such, a linear time-dependent distortion (TDD) model of these terms is also included (ACS IRS 2007-08, ACS IRS 2013-03, ACS IRS 2015-06). The SBC channel does not show appreciable time-dependence on the coefficients.
In addition to using SIP to correct distortion, additional corrections are carried out such as the pixel grid distortion imprinted by the manufacturing process and the non-polynomial filter-dependent component of the distortion. These can be found in ACS ISR 2015-06. A comparison of the HST coordinate system used to generate the geometric distortion solution to Gaia DR1 is detailed in ACS ISR 2018-01, and validations of the distortion solution using Gaia DR2 is detailed in ACS ISR 2020-09. An update of the SIP coefficients and the time-dependent distortion (TDD) model is currently underway.
The ACS/WFC geometric distortion and its time dependent corrections are corrected through the application of 3 reference files (IDCTAB, D2IMFILE and NPOLFILE) which are not applied by the normal CALACS processing. Distortion related corrections are instead applied in the DrizzlePac software that uses these reference files to remove distortions, populate the image header WCS keywords (linear terms) and populate SIP coefficients (high order terms). However, the time dependent distortion can only be applied using a version of the DrizzlePac software 2.0.0 or higher. For more information about DrizzlePac, please consult the DrizzlePac webpage.
The WCS package in astropy allows user to parse the header of a given ACS image, perform distortion correction, and transform between image and celestial coordinates.
Distortion Reference Files
Distortion Correction Tables (IDCTAB): Contains unique chip-dependent geometric distortion SIP coefficients for every filter in one FITS table. For the WFC channel, since the ACS/WFC distortion solution changed after Servicing Mission 4 in 2009, there are different IDCTAB files for ACS/WFC relating to before and after the servicing mission. While these files have the same format, each IDCTAB file contains different polynomial solutions for before and after the Servicing Mission as well as a change in time dependent coefficients. These reference files will be updated to include real solutions for other filters as new data and time allows.
Detector to Image File (D2IMFILE): A two dimensional correction for ACS/WFC pixel grid distortion in X and Y which is bilinearly interpolated within the DrizzlePac/STSDAS software. This reference file corrects for filter independent detector defects, and therefore only one file used for all ACS/WFC data. This replaces the ACS/WFC 68th column detector defect file previously used to correct for this distortion.
Non-polynomial Offset Files (NPOLFILE): Contains the high-order, filter-dependent distortion corrections for WFC, SBC, or HRC channel in a FITS format 2-D look-up-table. This reference file is specific for each calibrated ACS filter and (for WFC channel) contains information for each chip within the file format.
More information about the creation of the IDC file can be found in ACS TIR 2014-02 (available upon request). The reference files are available for download from the HST Calibration Reference Data System (CRDS).
Using The Reference Files
Basic steps
Get the resources: To use these reference files you must download the proper files (D2IMFILE, and the correct IDCTAB and NPOLFILE for your data). Make sure you have the new DrizzlePac software (version 2.0.0 or greater).
Update the global header: Set the global header keywords IDCTAB, NPOLFILE, and D2IMFILE to the path and filenames of the corresponding updated reference file.
Update the WCS: Run updatewcs to get the correct, geometrically accurate header coordinates.
In python, you would perform the first two steps as follows:
from astropy.io import fits
import glob
# First we update the headers to point to the location of the reference files on your machine
image_list = glob.glob('/path/to/your/data/*flc.fits')
for image in image_list:
with fits.open(iamge, mode='update') as hdu:
hdu[0].header['IDCTAB'] = '/path/to/your/IDCTAB_FILE.fits'
hdu[0].header['NPOLFILE'] = '/path/to/your/NPOL_FILE.fits'
hdu[0].header['D2IMFILE'] = '/path/to/your/D2IM_FILE.fits'
# Keep in mind that if you update one of the reference files, you should update them all.
# These files are built on one another and mixing reference files will create issues.
# With the headers updated to point to your local copies of the distortion reference files,
# we can now use the stwcs package to update the WCS information to use the new solution.
from stwcs import updatewcs
updatewcs.updatewcs(image_list)
Run the software: With the most recent distortion solution applied to the WCS, you may now run TweakReg to perform the image alignment and then AstroDrizzle to combine the observations.
Callout
More Information
An ACS Technical Instrument Report (TIR) on the creation of the IDCTAB file is available upon request.
For more information about AstroDrizzle, please consult the DrizzlePac webpage.
End callout
HST Prefooter
HST Help Desk
Please contact the HST Help Desk with any questions.

