STScI

The MultiDrizzle Handbook

TOC PREV NEXT INDEX PDF

6.4 WFPC2


6.4.1 Introduction

The HST calibration pipeline does not automatically drizzle (combine and clean) associated WFPC2 datasets, i.e. datasets employing a dither or mosaic pointing pattern (or a pattern defined with POS TARGs). In addition to the following example, the online WFPC2 drizzling cookbooks:

http://www.stsci.edu/hst/wfpc2/analysis/WFPC2_drizzle.html

provide more details and examples of drizzling WFPC2 data in the standalone environment. The online cookbooks provide reasonable first-pass parameters for quickly drizzling various types of WFPC2 datasets using PyDrizzle and MultiDrizzle. Select the cookbook that best represents your dataset, with regards to target placement and pointing strategy. For any given dataset, a few trial-and-error iterations are typically necessary to produce optimal results, so some guidance on inspecting your output and experimenting with parameters is included in each cookbook. Below some cookbooks are links to well-documented sample datasets, which illustrate the processing in greater detail (see their README files).

6.4.2 General tips

Specific applications of these tips appear in many of the cookbooks and sample datasets above.

  1. Drizzle input files: request only the *c0f.fits (science) and corresponding *c1f.fits (data quality) files from the archive, and their associated best reference files. Note that the best bias and dark corrections are generally not available until several weeks after your observations. So either wait to retrieve your data, or be prepared to re-retrieve it (via on-the-fly-reprocessing or "OTFR") and re-drizzle it. You will need to convert these FITS files to GEIS format.
  2. Create a uref directory and put your reference files in it. The drizzle software requires only the distortion correction files indicated in your image headers (keywords IDCTAB and OFFTAB), which can also be downloaded individually from the STScI uref directory.
  3. If your dataset involves large mosaic shifts (greater than 100 arcsec), and/or data from different epochs, orientations, or observing programs (using different guide stars), then you will need to measure and apply delta shifts to refine the image registration before combining your data.
  4. Output files: set build=no to generate separate files for science image (drz_sci.fits) and exposure weight map (drz_weight.fits). Set context=no to not generate the context image (drz_ctx.fits). Setting clean=yes leaves fewer intermediate files in your working directory, but you may need them for diagnostic purposes (see next bullet).
  5. Intermediate files: set clean=no to keep the intermediate files that are helpful while verifying your output and iterating. In addition to inspecting your output files, the median image (*_med.fits) should look almost as good as your final drizzled output, or else it will not help reject cosmic rays and artifacts very well. The single-drizzled images (*_single_sci.fits) may also help verify good cleaning, and may also be needed for image registration.
  6. Many types of detector artifacts are flagged in the calibration pipeline, and populate the data quality files (c1h). By default, the drizzle bits are set to zero, meaning any/all flagged pixels will be excluded from the processing. If you wish to include some of these pixels, set bits to include them (and sum the bits for multiple types). For example, to include saturated pixels and warm pixels, set bits = 8+1024 = 1032.
  7. If the target is on both the PC and WF chips, the data should be drizzled as if it is all WF data. Or the PC data could be drizzled separately (specify group=1) following instructions for PC data.
  8. If any part of your target falls on the WF4 chip, and the data was obtained in 2004 or later, you might need to apply the correction for the WF4 bias anomaly
  9. To minimize CPU time and disk space usage (especially during early experimental iterations), you can specify the center (ra,dec) and dimensions (outnx, outny) of your output image to center your target in the output (e.g. give NED coordinates), and limit the output to the minimal region of interest (e.g. only the area essential for measuring shifts). This can greatly improve your efficiency when working with large datasets, especially mosaics. Further, if your target falls on only one chip, you can process that chip (group) alone.
  10. Due to declining charge transfer efficiency (CTE), bright objects and artifacts (e.g. stars and cosmic rays) may have prominent comet-like tails of deferred charge in the anti-readout direction. You can use the driz_cr_ctegrow parameter to grow the cosmic ray rejections preferentially in the direction of these CTE tails.

6.4.3 NGC 2440 example

The Hubble Heritage Team obtained WFPC2 observations of the planetary nebula NGC 2440 on 6 Feb. 2007, as part of HST program 11090. The target is placed on the WF3 chip, and a sub-sampling dither box pattern was employed, so the resulting data can be drizzle-combined to a finer output scale, as described below.

Figure 6.28: Drizzled WFPC2 Image


 
Drizzled WFPC2 H-alpha (F658N) image of NGC 2440, showing the target primarily on the WF3 chip (North not up here).
 

6.4.4 Data calibration and image registration

We began with the standard pipeline-calibrated WFPC2 archival files (*c0f.fits and *c1f.fits). The entire dataset was taken within one visit, using the same guide stars. So we expect the data to already be well-registered. Nonetheless, small guiding excursions can still occur, and drizzling sub-sampled data to a finer output scale is very sensitive to any misregistration among the input frames. Two independent methods were used on the F675W frames (only), to refine the image registration. Using the centroided location of stars in each frame (tweakshifts task), and also a cross-correlation of nebular structure (crosscor task), small delta-shifts were measured and applied during image combination (below) via this shift file (h_n2440_f657w_shifts.txt):

   # frame: output
  # refimage: u9ws040jm_c0h_wcs.fits
  # form: delta 
  # units: pixels 
  u9ws040jm.c0h    0.0000   0.0000
  u9ws040mm.c0h    0.0136   0.0088
  u9ws040pm.c0h    0.0304   0.0205
  u9ws040sm.c0h    0.0245   0.0211

Since we are combining 4 exposures for each filter, the rejection of typical detector artifacts (bad columns and hot pixels) and cosmic rays, should be excellent. But there has been no manual masking of large artifacts such as satellite trails, scattered light (e.g. "dragon's breath from a bright star near CCD edges), or optical filter ghosts. So if they are present in this dataset, there could be residual artifacts of their incomplete rejection in the final output.

6.4.5 Image combination and cleaning

These instructions are intended for datasets where an optimally sub-sampling dither box pattern was used, and the target is primarily on the WF chip/s. De-archive the science and data quality FITS files to your working directory. Make a uref directory and download the distortion reference files (IDCTAB and OFFTAB in your image headers) into it, and define your uref directory (set uref). Convert the files to GEIS format (with strfits), and make a list of input images (list_c0h):

   > set uref = "/data/mymachine/uref/"
  > strfits *c0f.fits "" ""
  > strfits *c1f.fits "" ""
  > ls u*c0h > list_c0h  (no blank lines!)

After unpacking the FITS files to GEIS format (using strfits) and making an input list, the following MultiDrizzle parameters were used to combine and clean the four frames for each filter.

   multidrizzle.static = yes
  multidrizzle.static_sig = 4.0
  multidrizzle.skysub = no  
 
  multidrizzle.driz_separate = yes
  multidrizzle.driz_sep_outnx = 1600
  multidrizzle.driz_sep_outny = 1600
  multidrizzle.driz_sep_kernel = 'turbo'
  multidrizzle.driz_sep_wt_scl = 'exptime'
  multidrizzle.driz_sep_scale = 0.1  # the WF pixel scale
  multidrizzle.driz_sep_pixfrac = 1.0
  multidrizzle.driz_sep_rot = INDEF
  multidrizzle.driz_sep_fillval = -9.9   # arbitrary low value
  multidrizzle.driz_sep_bits = 0  # exclude all flagged pixels
   multidrizzle.median = yes
  multidrizzle.median_newmasks = yes
  multidrizzle.combine_type = 'median'
  multidrizzle.combine_nsigma = '4 3'
  multidrizzle.combine_nlow = 0
  multidrizzle.combine_nhigh = 1
  multidrizzle.combine_lthresh = '-8.8' #exclude empty pixels
  multidrizzle.combine_hthresh = 'INDEF'
  multidrizzle.combine_grow = 1
   multidrizzle.blot = yes
  multidrizzle.blot_interp = 'poly5'
  multidrizzle.blot_sinscl = 1.0
   multidrizzle.driz_cr = yes
  multidrizzle.driz_cr_corr = no
  multidrizzle.driz_cr_snr = '4.0 3.5'
  multidrizzle.driz_cr_grow = 1
  multidrizzle.driz_cr_ctegrow = 0
  multidrizzle.driz_cr_scale = '1.2 0.7'
   multidrizzle.driz_combine = yes
  multidrizzle.final_wht_type = 'EXP'
  multidrizzle.final_outnx = 1600
  multidrizzle.final_outny = 1600
  multidrizzle.final_kernel = 'square'
  multidrizzle.final_wt_scl = 'exptime'
  multidrizzle.final_scale = 0.06  # output pixels 60% of input pixels
  multidrizzle.final_pixfrac = 0.8 # shrink the drop size
  multidrizzle.final_rot = INDEF  # 0.0 to rotate North up
  multidrizzle.final_fillval = INDEF
  multidrizzle.final_bits = 0  # exclude flagged pixels
  multidrizzle.crbit = 0

Drizzling target region to sub-pixel scale (repeat for other filters):

   multidrizzle input='@list_c0h' output='h_n2440_f675w_s06n'

6.4.6 Output and data quality

The output pixel scale (0.06 arcsec/pixel) is 60% of the input detector scale (0.10 arcsec/pixel for the WF chips, since the target is on WF3 chip). A pixfrac of 0.8 was used. Optimal values for scale and pixfrac may be slightly different, and could be found with further experimentation. A good rule-of-thumb is to keep the rms of any region of the exposure weight map under 30% of the mean. The drizzled FITS files described here are available as High-Level Science Products (HLSP) via the Multimission Archive at STScI (MAST):

http://archive.stsci.edu/prepds/heritage/ngc2440/).

So as an exercise, the steps above could be repeated and compared to the HLSP images. Preview GIF images of these files are also available on the MAST Web site, and the resulting color composite image and related information are available from the associated STScI press release:

http://hubblesite.org/newscenter/archive/releases/2007/09/).

Space Telescope Science Institute
http://www.stsci.edu
Voice: (410) 338-1082
help@stsci.edu
TOC PREV NEXT INDEX PDF