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:
- ACS/WFC Detector to Image File (D2IMFILE): A 2-D (two dimensional) correction for ACS/WFC pixel grid distortion in X and Y which is by-linearly interpolated within the DrizzlePac/STSDAS software. This reference file corrects for filter independent detector defects, 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.
- ACS/WFC Distortion Correction Tables (IDCTAB): Contains unique chip-dependent geometric distortion coefficients for every filter in one fits table. This version of the reference file only contains unique polynomial solutions for F606W, F435W & F814W filters and contains the solution for F606W for all other, not yet calibrated, ACS/WFC filters. Even though the F606W solution is not technically correct for the other filters, in many cases it is an improvement over the old version of the reference file. Since the ACS/WFC distortion solution changed after Servicing Mission 4 in 2009, there are 2 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.
- ACS/WFC Non-polynomial Offset Files (NPOLFILE): Contains the high-order, filter-dependent distortion corrections for ACS/WFC in a fits format 2-D look-up-table. This reference file is specific for each calibrated ACS/WFC filter and contains information for each chip within the file format. As with the IDCTAB, only F606W, F435W & F814W have unique solutions. All other files contain the F606W filter dependent component of distortion.
How To Use The New Reference Files
- 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.
- 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, geometricly accurate header coordinates in the header.
- 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.
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
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
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