6.2 Image Alignment

Flat-field calibrated images from the calibration pipeline have been updated to incorporate the full distortion model that is stored in SIP header keywords and the updated CD matrix. This is done in the pipeline using the updatewcs task in the STWCS package. For ACS/WFC3, non-polynomial distortion corrections are stored as FITS extensions that were inserted in the images during pipeline processing by the updatenpol task in DrizzlePac. Images retrieved from the archive before AstroDrizzle was installed in the pipeline should either be re-retrieved or processed using updatewcs, and for ACS, also with updatenpol, before running any DrizzlePac tasks.


Alignment Error Sources

Sources of Alignment Errors:

  • Accurate Pointing repeatability:
    • For the most part, commanded and actual telescope dither pointings in a single visit are highly accurate: about two to five milliarcsec within an orbit, and five to twenty milliarcsec for contiguous orbits that need guide star reacquisitions within a visit. However, it is always useful to verify this by measuring the positions of a few objects in the *single_sci.fits images.
    • Images taken in different visits typically use different guide stars; since the positions in the guide star catalog have uncertainties as high as 0.2 to 0.5 arcseconds, it is very likely that the WCS from each visit will be mis-aligned at that level.
    • On rare occasions observations do not properly lock onto the guide stars which causes drifting and pointing offsets. A quick check of the keyword QUALITY (with details in the QUALCOM* keywords) in the image header will indicate if this anomaly occurred. If it did, it's best to discard these bad observations and realign those that are still useful.
  • An inability to get accurate centroids on objects like extended sources, targets obscured by dust, or faint objects with low signal-to-noise.
  • Long exposures that may suffer from blurring due to the changing velocity aberration of the telescope. Neglect of the velocity aberration correction can result in misalignments on the order of a pixel for WFC images taken six months apart for targets near the ecliptic. For further discussion of the effect of velocity aberration see the paper on "The Effect of Velocity Aberration Correction on ACS Image Processing proceedings" from the 2002 HST Calibration Workshop.

Processing Large Images

The same methods used to align and drizzle small images are also applicable to large mosaics and deep surveys. Every effort has been taken to ensure that drizzle algorithms are structured to provide the fastest computation and memory management. However, the user should consider limitations which exist due to the size of their data and the amount of memory available in the processing computer. More information on AstroDrizzle Memory usage can be read about in Section 5.2.11.

Using TweakReg for Image Alignment

The TweakReg task provides an automated interface for computing residual offsets for a group of flat-field calibrated images (*flt.fits, *flc.fits, etc.) before they are combined by AstroDrizzle.

Images are first aligned based on WCS information in the header. But if the images still remain slightly misaligned, they have residual offsets. This can occur when images are taken in different visits using different guide stars. The residual shifts between the visits are due to uncertainties in the guide star positions as discussed in Section 4.4. Smaller-scale residual offsets could also occur during guide star re-acquisitions for observations taken in a multi-orbit visit.

TweakReg is a WCS-based task, not pixel shift-based like previous software versions like MultiDrizzle. For images with residual offsets with respect to a reference image or catalog, WCS information in their headers are modified by TweakReg to "tweak" their WCS information to a common WCS with the reference image or catalog. In other words, TweakReg computes residual offsets that are used to update WCS header information in the images to put all images in a common coordinate frame.

Processing Steps Overview

A matched sources list is a list of common sources found in an input image and the reference image or catalog. 

TweakReg performs the following processing steps to determine a fit between each an input image and a specified reference WCS:

  1. It builds a catalog of source positions for each input image using one of these modes:
    1. Using a DAOFIND-like algorithm called ImageFind to detect stellar sources (the default mode).
    2. Using a user-supplied source catalog.
  2. The WCS from a reference image is selected from one of these options:
    1. The first input image (the default mode)
    2. An image specified by the user. Possibilities include:
      1. One of the input FITS files - perhaps an image that has the most overlap with other images.
      2. A different type of image - perhaps from another HST instrument or a different telescope.
  3. A reference catalog of sources is identified using either:
    1. A source catalog from the previously chosen reference image.
    2. A catalog of source positions on the sky (R.A., Dec.) provided by the user.
  4. All source positions for the input FITS images and reference source positions are converted to X,Y positions in the reference WCS tangent plane using all available distortion corrections provided by various distortion reference files. 
  5. For each input image and reference image pair, the difference in the source positions are represented in a two-dimensional histogram, allowing the determination of an initial offset based on the histogram peak in X and Y.
  6. Algorithm based on the xyxymatch IRAF task is used to match input source positions and reference image source positions using the initial offset from 5.
  7. For each input image, a fit to determine the most accurate offsets is performed on the matched sources lists; at this point, the user may inspect the fit residuals for each input image, then re-run TweakReg with different parameter values until a satisfactory solution is obtained. 
  8. When the user is satisfied with the fit, TweakReg can be run a final time with updatehdr set to True. This will update the headers of the input images with their new WCSs that put all images in the same coordinate frame.
  9. A headerlet can also be (optionally) created from the updated input image WCS. More details on the current headerlet's available for pipeline-drizzled HST data can be found here.

Catalog Matching between Input-Reference Pairs

A widely utilized method for computing offsets between images begins with identifying sources in each image. For each input image these sources are then matched with those in an overlapping section of the reference image or catalog, allowing offsets to be computed. This technique requires that each image contain recognizable sources, like point sources, that can be accurately identified and positionally measured by the software. There has to be enough overlap in each input-reference image pair so that enough real sources can be identified to calculate accurate offsets. TweakReg creates a catalog of source positions for each input image using an object identification routine similar to DAOFIND. The user also has the option to provide his or her own source position catalogs for each input chip.

Input files can be passed to TweakReg in several forms:

  1. The filename of a single image.
  2. The filename of an association (ASN) table.
  3. Wild card specification for files in directory (i.e., *flt.fits).
  4. Several filenames separated by a comma.
  5. An ASCII text file containing a list of input images, one per line, where the prefix "@" is specified before the file (i.e., @file_list).
  6. A Python list.

When comparing the input images, the TweakReg software defines the reference frame either by:

  1. The first image from the list of input images. (default)
  2. A catalog derived from a reference image specified by the user. The user can pick a specific reference image by setting the ref_image parameter in TweakReg.
  3. A source catalog provided by the user.

Aligning Under-Sampled Images

The source finding algorithm built into TweakReg has been optimized for point sources. The algorithm used to center on each source in the image works best with properly sampled PSFs, although it will work fairly well on the most strongly under-sampled detectors on HST: WFPC2, NIC3, and WFC3/IR.

In Figure 6.1, the apparent positions of stars in two WFC3/IR images (iabf01bxq and iabf01ckq), which have been offset by a simple shift along the detector X-axis of 24 arcseconds. They exhibit very systematic residuals up to +/- 0.1 pixels. These residuals arise because typical centroid-ing and PSF-fitting applications tend to move the position of a star in an under-sampled detector towards the center of the pixel in which the star is brightest. In order to avoid this bias, one must explicitly take the under-sampling of the detector into account. One method for doing this is the ePSF (effective PSF) method of Anderson and King (2006), an example of residuals found using their method on the same set of images can be seen below in Figure 6.2. A newer citation is also available in Bellini et al, 2018

Figure 6.1: Residuals from Aligning Two WFC3/IR Images Using TweakReg Source-Finding Algorithm



Figure 6.2: Residuals from Aligning two WFC3/IR Images with TweakReg Using Positions Determined with the ePSF Method