4.2 Distortion Corrections and Image Combination

Due to the tilt of the WFC3 focal plane with respect to the incoming light beam, the projected pixel area on the sky varies across the field of view in the raw (raw.fits) and calibrated (flt/flc.fits) images. As a result of the different projected pixel area on the sky, pixels in different regions of the detector collect a different amount of light, i.e. observations of a constant surface brightness object would have count rates per pixel that vary over the detector even if every pixel had the identical sensitivity. In WFC3, the pixel area on the sky varies by about 7% along the diagonal in UVIS images and about 8% from top to bottom in IR images.

In order to produce images that appear uniform for uniform illumination, the WFC3 flat fields include the effect of the variable pixel area across the field (see Section 5.4). However as a consequence of dividing by the flat field, two stars of equal brightness in an flt/flc.fits image falling on different portions of the detector would not have the same total counts. To perform point source photometry on calibrated ‘flt/flc.fits’ images, they must be multiplied by the effective pixel area map (see WFC3 ISR 2010-08). Alternatively, the pixel area effect is accounted for in the pipeline by drizzling, where the geometric distortion solution is used to correct all pixels to equal areas on the sky in the ‘drz/drc.fits’ data products. Because drizzling conserves flux, users should recover the aperture photometry from drz/drc images and from flt/flc images multiplied by the pixel area map.

4.2.1 AstroDrizzle in the Pipeline

WFC3 data obtained from MAST are corrected for geometric distortion with AstroDrizzle, which replaced MultiDrizzle in the OPUS pipeline for WFC3 data on June 7, 2012. During pipeline processing, calibrated data that belong to an association (e.g. as defined by the user in APT via a standard dither pattern, a REPEAT-OBS, or CR-SPLIT pair, see Table 2.2) are corrected for distortion and drizzle-combined with cosmic-ray rejection. If the associated images are dithered, they are aligned using the World Coordinate System (WCS) information in their headers before being combined. If there is no association table, each single-exposure WFC3 image is drizzled to correct for geometric distortion. Additional WFC3-specific rules define that images obtained with the same filter within a given visit are associated and thus combined.

AstroDrizzle uses the MDRIZTAB reference table to define a default set of parameter values that work well for most use cases. Each detector has its own MDRIZTAB, and each row provides the parameter settings specific to the number of input images per association. To correct for distortions, AstroDrizzle relies on the following reference files.

  • Image Distortion Correction Table (IDCTAB, high-order polynomial coefficients)
  • Detector to Image Distortion Correction (D2IMFILE, lithographic mask pattern correction for UVIS only)
  • Non-polynomial Filter-Dependent Distortion (NPOLFILE, 2-D look-up table for each calibrated filter)  

The names of the reference files used by AstroDrizzle are stored in the WFC3 UVIS and IR primary header keywords IDCTAB, D2IMFILE, and NPOLFILE. Users interested in these files may obtain them from CRDS.

As of December 2019, the MAST pipeline updates the astrometry (alignment) of WFC3 data with two approaches. The first, an “a priori” method, updates the positions of the guide stars used in a given image with the coordinates from Gaia, as these are typically more accurate than the positions from the Guide Star Catalog. The second approach, an “a posteriori” alignment of the data, when possible matches sources in the image to an external reference catalog (such as Gaia) and corrects for any offsets. These updates improve the absolute astrometry of WFC3 data products, especially when an a posteriori Gaia alignment solution is present. Further details regarding these improvements are discussed in WFC3 ISR 2022-06 as well as the Drizzlepac documentation.

During AstroDrizzle processing, the geometric distortion is extracted from these reference files and stored as Simple Image Polynomial (SIP) header keywords and as additional FITS extensions in the *_flt.fits/flc.fits images. Please refer to Table 2.4 or to Section 3.2.3 in the DrizzlePac Handbook for details.

The steps performed by AstroDrizzle include the following:

  • Correct the geometric distortion.
  • Project images onto a single pixel grid using the header World Coordinate System.
  • Match the sky background levels across overlapping images.
  • Perform cosmic-ray rejection using the *flt/flc.fits files as input. Note: IR flt data are already corrected for cosmic rays, but the drizzling process does identify further detector artifacts and rejects them during the combination process.
  • Convert the UVIS data from units of electrons to electrons per second; IR data are already in e-/s.
  • Combine associated (e.g. dithered) observations into a single product.

In addition to the improved astrometry in the standard pipeline products, two further versions of products are created in the MAST pipeline, referred to as Hubble Advanced Products.  The first of these are the Single Visit Mosaics, which improve the relative alignment of all images taken within a given visit (whilst the standard pipeline products mentioned above are aligned at the association level), and also attempt to align the images to the Gaia frame. The second type of advanced products are the Multi Visit Mosaics (MVM), which combine all images in a given filter within a given part of the sky. The MVM products do not perform any further realignment from the Single Visit Mosaics, so they may have alignment errors (e.g. when visits were taken at different epochs) and thus should be used as discovery products.  For more information, see WFC3 ISR 2022-06 as well as the Drizzlepac documentation.

4.2.2 Manual AstroDrizzle Reprocessing

Drizzled images combined in the pipeline were produced using a default set of parameters that are suitable for the widest range of scientific applications. These defaults, however, may not produce the optimum science data quality for many programs, and those images will require post-pipeline processing. 

Four main areas for improvement may include: (1) image alignment, (2) sky subtraction, (3) cosmic ray rejection, and (4) final image resolution. While single visit data with small dithers (like the 4-point dither box) are usually aligned to better than 0.1 pixel, the drizzled products are created using the native detector plate scale, and with a drop size, defined as the projected pixel shrinking factor (PIXFRAC), of 1.0. In these cases, the resolution of the drizzled products can be improved by fine-tuning the final sampling i.e. experimenting with the scale and PIXFRAC parameters.

While a significant portion of WFC3 data is aligned to Gaia by the MAST pipeline, the resulting relative astrometry for data taken in different visits of the same target may still have small errors which could degrade image combination. Thus, it may be necessary to manually refine alignment of data, and re-drizzle. Furthermore, there may be cases where the automated alignment does not obtain the best solution, in which case some manual reprocessing may be needed. In these cases, see the Drizzlepac Notebooks for guidance. 

Poor alignment can lead to improper cosmic-ray rejection, and inadvertent flagging of some astronomical sources as cosmic rays, compromising the photometric accuracy of the final data products. Additionally, a poor estimate of the sky background, for example in images where a bright target fills the frame, may also affect the accuracy of cosmic-ray rejection, and in turn, the resulting photometry.

4.2.3 AstroDrizzle Documentation

AstroDrizzle is available as part of the DrizzlePac software, which contains all the tools for manually reprocessing (aligning and combining) flc/flt HST images. This software may be obtained from the DrizzlePac web page. This page also provides useful resources such as the DrizzlePac Handbook and documentation, a 'Quick Start Guide' to drizzling, a set of example Jupyter notebooks, and some basic video tutorials.