STScI Logo

Hubble Space Telescope
ACS Distortion

Overview

ACS/WFC images suffer from extreme geometric distortions due to the optical assembly of the telescope. A new geometric distortion solution for the ACS/WFC has been derived employing a 5th order polynomial least squares solution combined with a new representation of the ACS/WFC X and Y time dependency. The new model also includes additional distortions on the top of the ACS/WFC geometric distortion, such as the pixel grid distortion and non-polynomial filter dependent component of the distortion. 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 processes. Distortion related corrections are instead applied in the DrizzlePac/STSDAS software that uses the reference files to remove distortions, populate the image header WCS keywords (linear terms) and populate SIP coefficients (high order terms). However, the new time dependent distortion can only be applied using a new version of the DrizzlePac software (version 2.0.0) which is available in SSBX after October 13, 2014.

OPUS will not be able to accept and apply the new geometric distortion until mid 2015 when the new version of DrizzlePac is ingested, but some users will be interested in applying this new solution in the meantime. Therefore, the ACS team will make these new referecnce files available to the users through the ACS website (see below) for those who wish to manually reprocess their data to take advantage of the new time dependent correction and updates to the distortion.

The New Reference Files

The new reference files include:

How To Use The New Reference Files

Basic steps

  1. Get the resources: To use these reference files you must download the propper 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), which should be available in new versions of SSBX.
  2. Update the global header: Set the global header keywords IDCTAB, NPOLFILE, and D2IMFILE to the path and filenames of the corresponding updated reference file.
  3. Update the WCS: Run updatewcs to get the correct, geometricly accurate header coordinates in the header.
  4. Run the software: Run TweakReg or AstroDrizzle with the "UPDATE WCS" option set to True. You only need to Update WCS once in either TweakReg or AstroDrizzle to apply the new solutions to the header. Doing so more than once will overwrite the current WCS information in the header.

Using Python

To update the header, change the IDCTAB keyword in the header to be the location (including full file name) of the new IDC reference file. Since the IDC file contains information for all filters in one file, the same file will be used for all images.

--> from astropy.io import fits
--> fits.setval(image_filename, 'IDCTAB', value='/location/of/IDCfile/IDCFILEname.fits')

Change the NPOLFILE keyword to be the full path of the new NPOL reference file:

--> fits.setval(image_filename, 'NPOLFILE', value='/location/of/NPOLfile/NPOLFILEname.fits')

And change the D2IMFILE keyword to be the full path of the D2IM reference file. Since the D2IM file is independent of filter, the same file will be used for all images:

--> fits.setval(image_filename, 'D2IMFILE', value='/location/of/D2IMfile/D2IMFILEname.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.

Once the headers are changed, update the WCS information to use the new distortion information by running:

--> from stwcs import updatewcs
--> updatewcs.updatewcs('*flc.fits') # update the WCS in the header.

Then the DrizzlePac programs (AstroDrizzle, TweakReg, etc.) can be run normally. If aligning then combining images, you will want to run TweakReg first, use:

--> import drizzlepac
--> drizzlepac.__version__ #make sure it is 2.0.0 or greater
--> from drizzlepac import tweakreg
--> tweakreg.TweakReg('*flt.fits',threshold=500)

Note: If updating the WCS in this way, do not use the updatewcs keyword in TweakReg or AstroDrizzle. If updateWCS is used more than once, any WCS information in the header, including all updates saved to the header from TweakReg will be overwritten and lost when re-running.

When you have a solution that you are satisfied with from TweakReg, make sure to update your header using the updatehdr keyword before continuing to AstroDrizzle. This writes the alignment solution to the header to be used later.

Then drizzle the images using the new solution and alignment by using:

--> from drizzlepac import astrodrizzle
--> astrodrizzle.AstroDrizzle('*flc.fits')

Download

WFC Distortion Files

More information

IDC file creation: http://www.stsci.edu/hst/acs/documents/tirs/tir1402.pdf

For more information about AstroDrizzle, please consult the DrizzlePac webpage.

A detailed description of CALACS is available at http://www.stsci.edu/hst/acs/performance/calacs_cte/calacs_cte.html

Created by: Dave Borncamp. Last updated: November 20, 2014