4.2 Combination of Dithered Data
4.2.1 Introduction to Dithering
Many ACS datasets are dithered - they have shifts between successive images which may be small or large. Dithering is a well established technique for HST imaging and has many advantages. For a general introduction to the concepts behind dithering, please consult the HST Dither Handbook (Koekemoer et al. 2002). Dividing observations into multiple exposures allows for the removal of cosmic rays, while dithering can be added for any combination of the following purposes:
- Sub-pixel shifts to improve the sampling of the PSF, since generally the ACS pixels are not quite small enough to fully sample the PSF.
- Shifts of at least a few pixels to enable detection and flagging of detector artifacts such as hot pixels, bad columns, etc.
- Shifts of order a few arcseconds in order to fill in regions not overed by the detector, like the WFC chip gap or the HRC occulting finger.
- Large shifts comparable to the detector size, in order to create mosaics of larger regions of sky.
Because the non-linear component of the ACS optical distortion is large, a given dither offset corresponds to different pixel shifts across the field of view. This must be taken into account when planning observations. For more information on ACS dither patterns, see the ACS Patterns section of the HST Phase II proposal instructions and also the ACS "dither" webpage:
http://www.stsci.edu/hst/acs/proposing/dither
4.2.2 Introduction to Drizzle
The methods for combining dithered ACS data described in this chapter are all based on the Drizzle method (Fruchter & Hook, 2002 PASP, 114, 144) and are described in detail in the HST Dither Handbook (Koekemoer et al. 2002). Here we give a brief summary of the method and refer the reader to the aforementioned documentation for further details and quantitative information about its properties.
Drizzle maps each pixel of the distorted input image onto pixels in a rectified, undistorted output image, taking into account shifts and rotations between images and the optical distortion of the camera. However, in order to avoid re-convolving the image with the large pixel of the camera, the user may shrink each input pixel before it is mapped onto the output image. This shrinking factor is known as the "pixfrac" and is normally between 0.0 (corresponding to interlacing input pixels onto single output ones) and 1.0 (which corresponds to shift-and-add). The degree of sub-sampling (the size of the output pixels relative to that of the original ones) is also a user controllable parameter called "scale" which is typically in the range 1-0.5 for the ACS.
The Drizzle algorithm has a number of important features. It preserves both absolute surface and point-source photometry, hence flux can be measured using an aperture whose size is independent of position on the chip, since all pixels in the output image have the same scale. And because the method anticipates that a given output pixel may receive no information from a given input pixel, missing data (due for instance to cosmic rays or detector defects) do not cause a substantial problem, as long as there are enough dithered images to fill in the gaps caused by these zero-weight input pixels. Finally, the linear weighting scheme is statistically optimum when inverse variance maps are used as the input weights.
It should be noted that, while the standard Drizzle "kernel" provides near-optimal results for combining multiple sub-pixel dithers, it is less ideal in the limiting case of a single image when both scale and pixfrac are nominally set to unity. This is equivalent to bilinear interpolation and results in strongly correlated noise and varying degrees of pixel sampling across the output image. This can be mitigated by using more optimal interpolators for the Drizzle kernel, for example the "Lanczos3" kernel which is designed to minimize correlated noise and maximize resolution, although it is less robust in dealing with missing pixels that have been flagged as bad. The various kernel options are all available within Drizzle which is implemented as an IRAF task within the STSDAS dither package, and can be run in stand-alone mode or invoked by PyDrizzle or MultiDrizzle.
4.2.3 Overview of Drizzle-Related Software Tools
The tools for the combination of dithered HST images have evolved through the years, starting with those developed for the Hubble Deep Field in late 1995. First came low-level tools which required considerable effort to use. Subsequently higher level wrapper scripts, written in the Python language, have been developed to ease such combination. Some of these capacities are now available within the pipeline. The main three levels applicable to current ACS imaging are as follows:
- The low level tools for mapping pixels from input to output images and support tasks for measuring shifts, detecting cosmic ray events, etc. are available within the dither package of STSDAS. These include drizzle itself and blot (reverse drizzle), as well as driz_cr for finding cosmic rays. The user will now probably prefer to access these tools via one of the wrappers rather than use them directly.
- PyDrizzle and associated Python scripts are layered on these and automate some of the processing. They convert the IDCTAB information into a form suitable for drizzle, create appropriate association tables and drizzle images into an appropriate output frame. The user will again probably not use these tools directly. PyDrizzle is available within the STSDAS system and requires the PyRAF environment. PyDrizzle was used by OTFR until September 2004.
- MultiDrizzle is a user-friendly script layered on top of the above tools and is generally recommended for use by observers. In addition to image registration and combination, it also provides automated detection and flagging of cosmic rays. As of 2004, MultiDrizzle is implemented in the pipeline with default settings that produce good results for many typical ACS dithered datasets. It provides access to many parameters for users who want to run it directly, and is available within the STSDAS system under the PyRAF environment.
MultiDrizzle and PyDrizzle are both Python scripts which require the PyRAF environment, as well as the latest version of the STSDAS package. It is recommended that the complete current STSDAS package is installed to avoid potential missing components or mismatched versions. STSDAS and PyRAF are available from:
http://www.stsci.edu/resources/software_hardware
While the software has been well tested and is fairly stable, it is still periodically being improved. We therefore refer readers to the MultiDrizzle web site for the most up-to-date software:
http://stsdas.stsci.edu/multidrizzle
and to the ACS Drizzling web site for additional documentation:
http://www.stsci.edu/hst/acs/analysis/drizzle
The following sections describe in more detail the tasks performed by PyDrizzle and MultiDrizzle and give some example of their use. A help document describing the numerous MultiDrizzle parameters can be accessed by typing 'help multidrizzle' from within PyRAF. The HST Dither Handbook is currently also under revision to include documentation for MultiDrizzle and several detailed ACS drizzling examples, and is expected to be released early in 2005.
4.2.4 Association Table Usage
In order to enable the Drizzle task to be used in an automated manner, two issues need to be addressed: calculating the required input parameters automatically, and working with a wide range of input image formats. PyDrizzle and MultiDrizzle rely on several features to address these problems:
- An association table relates multiple input images to a single output product.
- Python "structures" are created in memory for each input image and for the output image field.
- Output field parameters (RA/Dec of center, pixel size, field of view) are specified using a 'SkyField' function.
The calibration pipeline uses association tables to define how multiple images, taken at different pointings, relate to a single output image. These association tables are also then used to automatically combine and correct ACS dithered observations or any other related set of observations. Each input/output exposure in the association table contains information about:
- its own world coordinate system,
- the distortion model for its detector,
- the range of output pixels covered by the image, and
- any instrument specific characteristics.
This design provides the flexibility to support multiple instruments simultaneously, and to combine observations from several instruments into a single output field with arbitrary specification. The virtual output image is built using the World Coordinate System (WCS) information from each input image and the distortion model. This provides all the information necessary to calculate the input parameters for drizzle. These parameters are then passed to drizzle which actually performs the image combination.