STScI Logo

Hubble Space Telescope



All HST ACS/WFC images require corrections for geometric distortion due to the non-linear mapping of the sky onto the detector, known as the optical field-angle distortion (OFAD). This geometric distortion has been calibrated with respect to the Standard Astrometric Catalog based on observations of globular cluster 47Tuc (Anderson, 2007, ACS ISR). The geometric distortion is presented by a relatively low-order polynomial (up to 5th order) in the form of the reference file IDCTAB (Instrument Distortion Coefficients Table). During the calibration of the ACS/WFC geometric calibration we have found low-scale distortions coming from irregularities in the pixel grid of the ACS/WFC detector itself and in the various ACS/WFC filters used for calibrations. The irregularities in the pixel grid are clearly embedded into supposedly regular grid of pixels during the manufacturing process of the CCDs. These irregularities in the pixel grid can reach in amplitude up to about 0.4 pixels (equivalent to 20mas) and vary across of the ACS/WFC detector. On top of these irregularities, the expanding of the X and Y linear terms geometric distortion with time were found. The expanding in the X and Y linear terms with time are tiny and less then few micro-arc-seconds per year on the sky, but large enough to introduce geometric skew in ACS/WFC images.

On top of all these distortions there are also random "swirls" spawned by small variations in the pixel grid due to the optical properties of the filters, virtually in all filters. Such distortions are also smaller than 0.1 pixel (equivalent to 4 mille-arc-seconds on the sky) over small extent of 50-100 consecutive pixels acting as highest-order polynomial. Although all these distortions are small but large enough to be noticed while mosaicking images from sets of exposures with a range of dithers, time and the telescope roll angles.

To maximize the scientific output of ACS/WFC, these distortions should be calibrated and be corrected for. First, linear X,Y terms in the new IDCTAB are now represented by linear interpolation with time and kept in the header of IDCTAB. Second, the corrections for pixel-grid irregularities and non-polynomial filter-dependent part of distortion were formalized by constructing two-dimensional look-up tables fully covering each of the two ACS/WFC chips. These corrections are now presented in two reference files: D2IMFILE (Detector to Image) and NPOLFILE (non-polynomial filter-dependent part of distortion) which are bi-linearly interpolated by the STSDAS software DrizzlePac/Astrodrizzle.


V. Kozhurina-Platais, D. Borncamp, W.Hack and N. Dencheva

Plot of X&Y residuals between two ACS/WFC images taken 2 years apart and with different HST roll-angles as output from DrizzlePac/TweakReg with old (left four panels) geometric distortions reference files and the newest one (right four panels). The improvement in astrometric residuals is significant from 10mas down to 2mas.


TweakReg now provides support for aligning images that do not directly overlap with the reference image and/or catalog (eg. building mosaics). In the default configuration when the user does not supply their own reference catalog and/or image, this is done by choosing a pair of images (from the input list of images) with the largest overlap in the sky and trying to align them. One image will be used to produce the "reference catalog" while the other image will be aligned to this catalog. Now, the sources from the second image that have not been matched to the reference catalog are considered as "good new sources" and will be added to the reference catalog. This way, the reference catalog keeps expanding with each new matched image. With a large (expanded) reference catalog now it is possible to align images that did not have a direct overlap with the starting image. This feature can be turned off using the "expand_refcat" parameter only when the user provides his/her own reference catalog that is of high confidence and the user does not desire TweakReg adding new sources to this high quality catalog.


TweakReg’s source finding task (imagefind) now includes additional parameters to exclude false detections and allow the software to more easily solve for the image offsets using matched sources lists. For example, ‘dqbits’ is a list of DQ flag values to include as ‘good’ or to exclude as ‘bad' before generating and matching source lists. For WFC3/UVIS, setting dqbits=-16 will mask hot pixels flagged by the instrument team, eliminating a common problem where TweakReg locks onto hot pixels and solves for the dither pattern. This can occur when users set the detection threshold value too low and hot pixels outnumber astronomical sources. Other new parameters allow selection for sharpness and roundness, which give users better control over source selection criteria and the mitigation of artifacts.


The new TweakReg software makes it easier for users to align different HST detectors by allowing for separate sets parameters (threshold, conv_width, etc) between the input list and the reference image. For example, the command used to align WFC3/UVIS and WFC3/IR images would be:

>>>  tweakreg.TweakReg(‘@wfc3_uvis_flt.list',\


Alignment of HST data to non-HST images refers to the process of modifying the WCS information in the header of the HST image so that sources in the HST images match the positions of the same sources in the non-HST image. This will correct the astrometry of the HST data to match that of the non-HST image, presumably to allow comparisons of the HST data with other published results. The alignment to a non-HST image can only be performed when all distortions have been corrected in the WCS of the non-HST image. Spitzer images, for example, typically include SIP distortion coefficients as part of their WCS. On the other hand, SWIFT and DSS images do not contain any description of distortion in the WCS keywords.

One requirement for getting non-HST images to work with the DrizzlePac code remains an adherence to the FITS standards for multi-extension files and for describing the WCS. The DrizzlePac code relies on wcslib through the astropy.wcs (previously, the pywcs) library to read in the WCS keywords. In addition, HST multi-extension FITS files specify the extensions using EXTNAME and EXTVER keywords to designate the SCI, ERR and DQ extensions, and the code expects all inputs to conform to the same conventions. This may require updating the headers of the non-HST images to include these keywords to match the format of HST images.
This was done easily for SWIFT data using the following commands:


>>>  from import fits as pyfits 
>>>  cp sw00031905002uuu_sk.img sw00031905002uuu_sk.fits 
>>>  swift ='sw00031905002uuu_sk.fits', mode='update') 
>>>  swift[1].header['EXTNAME'] = 'SCI'< 
>>>  swift[1].header['EXTVER'] = 1< 
>>>  wift.close() 

The file in this example (sw00031905002uuu_sk.fits) can now be used as a reference to align non-HST images with no additional changes. For example, the command to align a set of FLT files to the SWIFT file would be:

>>> tweakreg.TweakReg(‘*flt.fits', \

and if you already have a reference catalogue (with the name ''), you would use the following command:

 >>> tweakreg.TweakReg(‘*flt.fits',\

This specific SWIFT image corresponds to an image of M83 that overlaps with images taken by HST/WFC3 in Proposal 11360 using the F814W filter, the same images described in DrizzlePac Handbook Chapter 7.5 "WFC3/UVIS: Aligning Images by Defining an Output Frame". The HST images can be drizzled together to form a cosmic-ray cleaned, distortion free image, then aligned to the SWIFT image. The updated drizzled HST image can then be used to correct the WCS in the calibrated HST images that went into creating the drizzled image using tweakback and all HST images would then be aligned to the SWIFT image. The sources found in the SWIFT image and the drizzled HST image can be seen in the included figures, with the alignment being limited by the large pixel size for the SWIFT image.

These images do not demonstrate the most accurate use of this technique, rather that the DrizzlePac code can be used to align HST images to non-HST data. Furthermore, although it would seriously degrade the HST data, the SWIFT image could also be used to define the output results from drizzling the HST images if desired using astrodrizzle. The SWIFT image would simply need to be provided as the 'final_refimage' parameter in astrodrizzle to create an HST product that matches the alignment and pixel scale of the SWIFT image. The animated GIF below shows an HST image drizzled using the SWIFT image as reference.


Please note that due to the fact that non-HST images do not provide full distortion solutions in the WCS and that the code was developed to support HST images only, non-HST images can NOT be aligned to HST images or drizzled with astrodrizzle without heavy manual modifications to the headers of the non-HST images. Such changes are beyond the scope of normal usage and will only be supported as resources permit by contacting

W.Hack and M. Cara