4.4 MultiDrizzle
MultiDrizzle (Koekemoer et al. 2002, HST Calibration Workshop 2002, p.337), is a general purpose script for performing automated registration, cosmic ray rejection and drizzle combination of images. It provides a single-step user-friendly interface to PyDrizzle and to the other drizzle-related of tasks in the STSDAS dither package. For a general introduction, refer to the HST Dither Handbook (Koekemoer et al. 2002).
4.4.1 Steps Performed by MultiDrizzle
For ACS data, MultiDrizzle starts with the flat fielded, but still distorted, FLT files created by CALACS. While this is the only mandatory input, there are many additional optional inputs including lists of improved user-determined shifts. In default mode, MultiDrizzle performs the following steps in order, although the user has full control via the parameter file, of which steps are to be performed or omitted. Each step is described in detail in Section 4.5 and Section 4.7
- Bad pixel masking, to identify additional bad pixels that may not be present in the image DQ array or BPIXTAB reference file
- Sky subtraction on each individual input image (optional)
- Initial image registration (based on world coordinate system information in the header keywords) and drizzling to separate output images
- Combining the separate drizzled images to create a clean median
- 'Blot' transformation of the clean image back to the frame of each input image
- Creation of a cosmic ray mask for each input image, based on a comparison between the blotted image, its derivative, and the original input image
- Final drizzle combination, applying the cosmic ray and bad pixel masks
The goal of MultiDrizzle is to provide a high-level task that has an extensive suite of user-adjustable parameters with default values that will produce good results for a wide variety of standard dithered datasets with no user intervention. At the same time, the parameters allow the user a large amount of flexibility in controlling the relevant aspects of these steps, in case the default parameters are not sufficient for specific scientific applications. The default MultiDrizzle parameters are listed in the example in Section 4.7.
4.4.2 Multidrizzle in the ACS Pipeline
The ACS calibration pipeline currently consists of 2 processing stages, namely CALACS followed by MultiDrizzle. Standard CALACS processing includes bias and dark subtraction, removal of the overscan regions, and flat fielding. It will produce, among other products, a calibrated image with the FLT suffix for each input file. The CALACS portion of the pipeline will calibrate and combine CR-SPLIT images. It will not, however, correct for geometric distortion or combine images from multiple dither positions.
Geometric distortion is removed for all images (dithered or not) in the second stage of processing via MultiDrizzle. This software makes use of the ACS association tables, allowing the pipeline to combine associated dithered observations for a single visit into a single image. Finally, MultiDrizzle converts the data to units of count rate (electrons/sec). Regardless of whether observations were taken as a single image or a set of dithered exposures, MultiDrizzle produces images which are both astrometrically and photometrically accurate.
Processing comments are recorded in the trailer file for the DRZ image, including which version of drizzle was used, what parameters were used, and which images were combined (if dithered). The same default parameters are used for all observations in the pipeline, and are recorded in the MDRIZTAB reference files that are delivered along with the data. These parameters were chosen to avoid introducing any scale changes, shifts, or rotations relative to the original pointing, aside from those corrections incorporated in the distortion model itself. While the pipeline products will be properly corrected for distortion, the combination of dithered observations may not be ideal, and small pointing errors or defects, such as hot pixels or cosmic-rays, may still be present. In this case, we refer readers to Section 4.5 for instructions on post-pipeline reprocessing. For well dithered data, some resolution may be recovered by decreasing scale/pixfrac.
The current version of MultiDrizzle uses the image header world coordinate system (WCS) to deduce the image-to-image offsets. However, user-supplied offsets may also be applied via a shiftfile during reprocessing. Tasks to ease the determination of such shifts are currently being developed. MultiDrizzle processing with default parameters has been part of the standard HST pipeline processing since September 2004.
4.4.3 Data Quality Flags for Bad Pixels: The 'Bits' Parameter
The data quality flags which were set during CALACS processing can be used as bit masks when drizzling, and the user may specify which bit values should actually be considered 'good' and included in image combination. This is done via the parameters 'driz_sep_bits' and 'final_bits'. Any pixel flagged otherwise will be considered 'bad' and will be given zero weight. If a pixel is flagged as bad but has non-zero weight in any other image, the pixel will be replaced with the value from that image during image combination. Otherwise, the pixel will be replaced with the 'fill value'. The default 'fill value' used by MultiDrizzle during pipeline processing is 'INDEF'. If the 'fill value' is set to INDEF during reprocessing with MultiDrizzle, and if there are no pixels with non-zero weight, the pixel will retain its original value.
The flags for the DQ array were presented in Chapter 3 and are summarized in Table 3.4. The bits value used during pipeline processing is 96 which is the sum of 32 and 64 (two flag values for warm pixels). Note that these pixels were flagged during CALACS processing as "bad" or "suspect", but may have been corrected in later processing steps. The bits parameter indicates which "suspect" pixels to keep. When the total counts in a given pixel have exceeded the full well, for example, the DQ flag is 256. However, testing shows that counts still accumulate in a highly linear manner and that photometry of saturated stars is quite practical if using a gain that samples the full well depth.
The default bits value in the off-line MultiDrizzle software available for reprocessing is zero, but can be reset by the user prior to reprocessing. The value chosen for this parameter is completely up to the user and should be selected based on the specific calibration needs. For HRC processing, the user may want to add 8 (masked by aperture) to the value so that pixels which lie behind the occulting finger mask are not given zero weight. (In Figure 4.7 of Section 4.5.1, bit 8 is not included in the bits parameter prior to drizzling. Pixels behind the occulting finger were therefore given zero weight and replaced with the default fill value=zero.) Of course, the photometry in this region will be inaccurate due to improper flat fielding, so this bit would likely only be set for aesthetic reasons.
4.4.4 MultiDrizzle Data Products
The output from MultiDrizzle is a single multi-extension FITS file with the suffix '_drz.fits'. The first extension contains the science (SCI) image which is corrected for distortion and which is dither-combined (or mosaiced), if applicable. The drizzled SCI image is in units of electrons per second. All pixels have equal area on the sky and equal photometric normalization across the field of view, giving an image which is both photometrically and astrometrically accurate for both point and extended sources. The dimensions of the output image will be computed on-the-fly by MultiDrizzle and the default output plate scale will be read from the IDCTAB. These parameters, however, may be chosen by the user during reprocessing to best suit the actual data.
The default pixel scale for the output image is unity, i.e. output pixels have the same scale in arcseconds as the pixels of whichever camera was used to obtain the data (WFC, HRC or SBC). In addition, the value of pixfrac is set to 1 for less than 6 exposures, and is set to 0.8 for 6 or more exposures where dithering provides better sampling of the sub-pixel plane. Finally, the default orientation for images from the pipeline is in the unrotated frame (with amplifiers A and B always at the top, see Figure 1.1). If a different orientation is desired (for example, with North to the top), this can be easily achieved by re-running MultiDrizzle off-line once the data have been retrieved.
The second extension of the output image contains the weight (WHT) image. It gives the relative weight of the output pixels and can be considered an effective exposure time map. The data quality map created by CALACS is used by MultiDrizzle via the "bits" parameter in creating the weight image (See Section 4.4.3).
The third extension of the MultiDrizzle output image contains the context (CTX) image which encodes information about which input image contributes to a specific output pixel. This is done using a bitmask for each output pixel, where 'bit set' means that the image, in the order it was combined, contributed with non-zero weight to that output pixel. The context image starts as a single 32-bit integer image but can be extended with additional 32-bit deep planes, if there are more than 32 input images.
Finally, it should be noted that the calibrated FLT files contain additional bits in the DQ mask that identify pixels flagged as cosmic rays by MultiDrizzle. The default value for these bits is 4096, and if MultiDrizzle is re-run on the FLT files offline it will be able to use these flags and proceed directly to the final drizzle step without the need to re-do cosmic ray masking, unless that is required. Alternatively, if the cosmic ray rejection needs to be improved, then the pipeline CRs can be ignored/reset by adding 4096 to the "bits" parameter value when running MultiDrizzle.