STScI

The MultiDrizzle Handbook

TOC PREV NEXT INDEX PDF

6.3 NICMOS


6.3.1 Introduction

This example describes the combination of NICMOS data from program 7115 (PI: Dean Hines), a series of NIC2 observations of the CRL 2688, the Egg Nebula. In this example, we will generate drizzled images of the Egg Nebula as seen using the F165M, F190N, and F212N filters.

Prior to attempting this example, we assume that users have worked through the examples in the previous sections and are familiar with using [association tables] and [shift files]. NICMOS observations may be taken independently or specified as an associated dataset - in which case an ASN table will be delivered with the data from the archive. When requesting the data for proposal 7115, you will automatically obtain a set of ASN tables associating several datasets together. In this particular example however, these ASN tables contain no information about offsets and rotations between observations. We will describe how to determine these in the following section. The table below replicates the default information which is available in the ASN table n3uv01020_asn.fits. It is also possible to create your own association table for datasets you would like to combine, or merely specify a unique rootname to MultiDrizzle and the software will create the table.


Table 6.5: Default ASN table of the F190N images used in this examples
MEMNAME
MEMTYPE
MEMPRSNT
N3UV01ALQ
EXP-DTH
yes
N3UV01AMQ
EXP-DTH
yes
N3UV01ANQ
EXP-DTH
yes
N3UV01AOQ
EXP-DTH
yes
N3UV01020
PROD-TARG
yes

6.3.2 NICMOS Specific issues

There are several properties of NICMOS data which can affect the proper working of MultiDrizzle. In particular, NICMOS images are subject to a several additive signals present in raw NICMOS data, such as the Pedestal effect, which is dealt by the NICMOS calibration pipeline. These corrections however can be less than optimal and result in a significant amount of residuals in pipeline calibrated NICMOS data. Running MultiDrizzle on NICMOS data where these effects have not been totally removed will result in an improper background determination, cosmic ray removal for example. Users are encouraged to individually check the background levels of their pipeline calibrated NICMOS images to ensure that effects such as Pedestal have been properly removed before proceeding with MultiDrizzle.

6.3.3 Initial Setup

In this example, it is assumed that the user has requested and obtained all files and calibration products from the HST archive. While the geometrical distortions in NICMOS are small, the best results will only be achieved when these are taken into account by MultiDrizzle. The NICMOS IDCTAB files can be obtained from the NICMOS instrument Web pages or the HST data archive, or can be downloaded together with the calibrated data from the HST Archive. The following is a list of all the available CAL files for program 7115 in all filters (all are taken using the NIC2 detector):

 
n3uv01alr_cal.fits
n3uv01amr_cal.fits
n3uv01anr_cal.fits
n3uv01aor_cal.fits
n3uv01arr_cal.fits
n3uv01asr_cal.fits
n3uv01atr_cal.fits
n3uv01avr_cal.fits
n3uv01awr_cal.fits
n3uv01axr_cal.fits
n3uv01ayr_cal.fits
n3uv01b1r_cal.fits
n3uv01b2r_cal.fits
n3uv01b3r_cal.fits
n3uv01b4r_cal.fits
n3uv01b6r_cal.fits
n3uv01b7r_cal.fits
n3uv01b8r_cal.fits
n3uv01b9r_cal.fits
n3uv01bbr_cal.fits
n3uv01bcr_cal.fits
n3uv01bdr_cal.fits
n3uv01ben_cal.fits
n3uv01bgm_cal.fits
n3uv01bhm_cal.fits
n3uv01bim_cal.fits
n3uv01bkr_cal.fits
n3uv01blr_cal.fits

The appropriate calibrated science files along with the associated calibration reference files should be placed in the user's local disk area. These should minimally include:

Next, make sure the `nref' directory is defined in your OS environment shell. Start PyRAF, and load the dither package by typing "stsdas" and then "dither". To run MultiDrizzle, the parameters may be edited in the standard way using the "epar" facility. We recommend that beginners use the `epar facility' to become familiar with all steps and parameters before running from the command line. MultiDrizzle software has an extensive set of parameters, but the default values should allow the task to process nearly any set of images for an initial review. The parameters are separated according to the processing step they control, making it easier to interpret them.

Next, we need to identify and create list of datasets taken with the same filters. This can be done in Pyraf using, for example:

  hselect *cal.fits[0] $I,TARGNAME,CAMERA,FILTER yes > all.lst

The content of the file all.lst can then be used to generate lists of datasets in each filter. For example using (the ! is necessary if this is done within iraf or Pyraf):

  !awk '$2=="CRL2688" && $3==2 && $4=="F190N" \
     {print substr($1,0,18)}' all.lst > F190N_NIC2.lst
 !awk '$2=="CRL2688" && $3==2 && $4=="F165M" \
     {print substr($1,0,18)}' all.lst > F165M_NIC2.lst
 !awk '$2=="CRL2688" && $3==2 && $4=="F212N" \
     {print substr($1,0,18)}' all.lst > F212N_NIC2.lst

In this example, we describe the parameters for each step in succession, though in practice, the user would set all relevant parameters at once. While the majority of relevant parameters are discussed here, a help document describing all parameters and tasks can be accessed by typing `help MultiDrizzle' from within PyRAF. Note that running MultiDrizzle on a modern computer with NICMOS data is not very time consuming. While we sometimes will need to only examine intermediate MultiDrizzle products, such as when generating the offset corrections, or creating a cosmic ray free median image, we sometimes just run the entire MultiDrizzle process. This limits the number of times we have to reset the various parts of MultiDrizzle.

6.3.4 The Default Parameters

The default MultiDrizzle parameters usually produce satisfactory results. It is recommended to first run MultiDrizzle on NICMOS data with default parameters and to them slowly modify these to improve the qualify of the end product. The main limiting factors in NICMOS data is that these data sometime suffer from a significant amount of amp glow near the corners of an exposure and/or of the `Pedestal` effect. This causes the sky background of NICMOS data to be quadrant dependent and non uniform and can lead so some problems when combining these images together (such as inconsistent sky across the image). It is recommended that in these cases, users pay particular attention to manually correcting for the Pedestal effect and amp glow. More information about these and how to correct them can be found in the NICMOS Data Handbook. Sky estimation can also be thrown off by crowded fields or bright objects. Datasets such as these should be closely inspected to ensure the correct sky correction has been made for each dataset before the drizzling process has started.

The only required parameter is the rootname for the `output' drizzled product. By default, MultiDrizzle will look for all files in the working directory with the FLT extension. However, this is specific for ACS processed data. The first calibrated output from the NICMOS calibration pipeline are the *_CAL.FITS files. At a minimum the user should start with these. If additional processing, such as pedestal removal, South Atlantic Anomaly (SAA) correction has occurred, then the appropriate extension for the final calibrated images should be supplied. The user may modify the `suffix' parameter to include some other extension or may specify a subset of images via the `filelist' parameter. Using the images specified, MultiDrizzle calls PyDrizzle which uses the buildAsn task to create an association table named `output_asn.fits'. This association will be used to define the dataset. The header WCS information from the entire set is used to define a common WCS output frame, and MultiDrizzle sets the drizzle parameters appropriately. If user defined shifts are available, these may be specified in the `shiftfile' parameter, and the association table will be updated accordingly. However, a shift file is not usually available until after step 3, separately drizzling the images onto a common WCS, has been performed and objects matched.

A reference image which has the desired output WCS may be specified, and the input images will be centered to match the WCS of this image. Alternately, the central RA and Dec (ra, dec) of the reference pixel and the dimensions of the output frame (outnx, outny) may be specified, if desired, though reasonable values will be automatically determined from the images' WCS if these parameters are left blank. While the central RA and Dec are specified in the initial setup parameters listed above, the output image dimensions are specified in both the `driz_separate' and `driz_combine' parameters in steps 3 and 7, respectively.

The `crbits' parameter is defined as the integer sum of all bit values from the input images' DQ array that should be considered `good' when building the weighting mask. Because MultiDrizzle was designed for use with multiple instruments, the default value is set to zero. For NICMOS data, the recommended default value is SATURA. Information from the DQ array for each chip is used in combination with the `bits' parameter to create temporary mask files called `*_mask1.fits'. Pixels which were flagged in the DQ array and which were not specified as good via the bits parameter are assigned the value 0. All other pixels are set to 1 in the mask. The following table summarizes the values in the DQ array for NICMOS:


Table 6.6: NICMOS Data Quality (DQ) Flags
Name
Value
Description
REED_SOL
1
Reed-Solomon decoding error
BAD_LIN
2
Poor linearity correction
BAD_DARK
4
Poor dark correction
BAD_FLAT
8
Poor flat field correction
GROT
16
Pixel affected by "grot"
DEFECTIVE
32
Hot or cold pixel
SATURATED
64
Saturated pixel
MISSING
128
Missing data (telemetry dropout)
BADPIX
256
Bad pixel set during calibration
CR_HIT
512
cosmic ray hit
SOURCE
1024
Pixel contains source
ZEROSIG
2048
Zero read signal correction
USER1
4096
User flag value 1
USER2
8192
User flag value 2
HIGH_CURVATURE
16384
High curvature in ramp
RESERVED2
32768
Reserved flag value 2

The distortion reference file is read from the image header via the IDCTAB keyword which specifies the name and location of the appropriate file. The distortion coefficients for each chip are written to temporary ascii files named `*_coeffs?.dat'. If the user wishes to retain these files, the parameter `clean' should be set to `no'.

In general, the default parameters will work well for most data. When setting up this example, we have specified only the following non-default parameters:

The choice of these last two parameters is explained in the sections that follow. In default mode, MultiDrizzle performs each of its 7 steps in order. In this example, however, we perform some of the steps and examine the intermediate products before final drizzle combination is performed. Approximately 1GB of free disk space is required for this example when intermediate products are not removed. An outline of the entire process is described below:

  1. Run MultiDrizzle to create sky-subtracted, separately drizzled images (*single_sci.fits) which are based on a common WCS. (MultiDrizzle Steps 1 through 3)
  2. Measure the positions of stars, or cross correlate images generated above (* single_sci.fits), to derive a residual delta shift file (shiftfile) which defines the residual offsets.
  3. Run Mutlidrizzle again, now using the shiftfile created above, to create new separately drizzled images as well as a well-aligned median image of the field. MultiDrizzle Step 5 through 7 can be turned off at this stage to save processing time.
  4. Examine the median image to ensure that images were properly combined. The median image should contain as little artifacts as possible. Also, if the alignment of the individual images has been properly corrected, stellar PSFs should be `round' and `narrow'.
  5. If the quality of the median image is satisfactory, and if Step 5 through 7 were turned off above, run MultiDrizzle with steps 5 through 7 turned on. This will transform the median image back to the reference frame of each of the original input images and derive cosmic ray masks. Using these new masks, perform the final drizzle combination and produce the final drizzled image.

The steps outlined above should be followed in an iterative manner, tweaking the necessary parameters until a given intermediate product reaches the expected quality (e.g. median image). The process can be safely be run several times over the same input files. Be warned however, than the bad pixel maps of the input CAL files is modified and that pixels flagged as CR by MultiDrizzle are updated in the DQ extension of the input CAL files. Users might hence want to always run MultiDrizzle on fresh, unmodified, copies of the input CAL files.

While above we refer to running only a subset of the MultiDrizzle steps (such as Step 1 through Step 3), the user can very well run the step every single time. While it is possible to turn off subsequent steps manually in MultiDrizzle, the processing of NICMOS data is not time consuming on a modern computer and not much time will be wasted if, while following this tutorial, you choose to run all MultiDrizzle steps every time you run MultiDrizzle. However, keep in mind that intermediate, or final products will be produced and that these might be useless, have artifacts etc. and will only become acceptable as every tweak of the parameters, shift between individual files, editing of bad pixel masks, etc. are done.

6.3.5 Step 1: Static Mask

Figure 6.12: Image of EPAR Frame for the First Drizzle Step


 
STEP1 in the process
 

When `static=yes', this step goes through each of the input images, calculates the rms value for each chip, and identifies pixels that are below the median value by more than `static_sig' times the rms. It is aimed at identifying pixels that may have high values in the dark frame, which is subtracted during calibration, but may not necessarily have high values in the images, and thus subtraction gives them strongly negative values. Such pixels are not always flagged in the DQ file, and this step allows them to be identified. Sometimes such pixels fall on bright objects so instead of being negative, they would be positive but lower than surrounding pixels. If the images are dithered, then they should land on blank sky at least some of the time, in which case they will appear negative and will be flagged.

6.3.6 Step 2: Sky Subtraction

Figure 6.13: Image of EPAR Frame for the Second Drizzle Step


 
STEP 2 in the process.
 

When `skysub=yes', this task will subtract the sky from each input exposure. Two important parameters to consider are the upper and lower values for data that will be used to estimate the sky value. These should be set to include most pixels in the sky (so substantially more than the FWHM of the sky distribution) but not so large as to include a substantial amount of power from objects or cosmic rays.

The `SkySub' task will update the header keyword defined by the parameter `skyname' with the derived sky value for each chip and will subtract the sky from the original exposures prior to the final drizzle combination. Note that the CAL images themselves are not modified when MultiDrizzle completes, although the sky value is stored in the images headers as the MDRIZSKY keyword. Sky subtraction is recommended for effective cosmic ray flagging and removal, but only if sufficient blank sky is available to perform an accurate determination. Great care must be taken when choosing to implement sky subtraction, because if sufficiently blank sky is not available, sky subtraction will produce erroneous results. In the case of the Egg Nebula images, adequate blank sky is available to allow an accurate sky determination.

6.3.7 Step 3: Drizzle separate images and Refining Offsets

Figure 6.14: Image of EPAR Frame for the Third Drizzle Step


 
STEP 3 in the process.
 

MultiDrizzle uses the world coordinate system (WCS) information in the image headers to align the images. While dithers applied to a target within a single visit of HST are usually accurately reflected by the WCS, this is not the case for multiple visits which normally require guide star re-acquisitions and may utilize different guide stars. Even for nominally back-to-back exposures, offsets large enough to degrade final combinations do sometimes occur. As a result, it is essential to accurately determine image-to-image shifts (delta shifts), and possibly rotations, before running MultiDrizzle. These (delta) shifts may be determined by separately drizzling each image onto a common WCS frame.

This is accomplished with the help of the products output by the `driz_separate' task in step 3. Object lists derived for each drizzled image may then be matched and fit to derive a single shift for each image. Once the shifts have been determined, MultiDrizzle must be rerun from the beginning with the shift file specified in the `shiftfile' parameter. MultiDrizzle will update the association table to reflect these `delta' offsets and will now use both the header WCS information plus the shift file to appropriately align images.

In this example, we choose to compute these offsets using a cross correlation. Different approaches are possible to determine residual offsets between images however, such as manually measuring the position of sources in individual images.

  crossdriz n3uv01anr_single_sci.fits \
       n3uv01anr_single_sci.fits cross1x1
 crossdriz n3uv01amr_single_sci.fits \
       n3uv01anr_single_sci.fits cross1x2
 crossdriz n3uv01alr_single_sci.fits \
       n3uv01anr_single_sci.fits cross1x3
 crossdriz n3uv01aor_single_sci.fits \
       n3uv01anr_single_sci.fits cross1x4

Shifts are then computed from the cross* files generated above using the shiftfind program from the IRAF fitting package. Again, after loading the fitting package, this can be done with the following commands:

  shiftfind cross1x* shifts.F190N.txt

The result if a simple text file, shifts.F190N.txt. The content of this file is shown below:

  n3uv01anr_single_sci.fits  0  0.0001 0.0490  -0.0003 0.0386  0.00  
287.85
 n3uv01amr_single_sci.fits  0  0.1354 0.0497   0.1049 0.0385  0.00  
287.85
 n3uv01alr_single_sci.fits  0  0.3194 0.0497  -0.0148 0.0381  0.00  
287.85
 n3uv01aor_single_sci.fits  0  0.1395 0.0502  -0.1362 0.0402  0.00  
287.85

The file generated by the shiftfind routine can be edited into a properly formatted MultiDrizzle input shift file format, which we name shifts.F190N in this example:

  # units: pixels 
 # frame: input
 # form: delta
 n3uv01anr 0.0001   -0.0003    0.00   
 n3uv01amr 0.1354    0.1049    0.00   
 n3uv01alr 0.3194   -0.0148    0.00   
 n3uv01aor 0.1395   -0.1362    0.00

In the example above, each line shows the dataset name, followed by the x and y delta offsets, in pixels, followed by the optional rotation in degree and which in this case we simply set to zero.

While we use the crossdriz and the shiftfind program to compute offsets between these exposures, users are free to use whatever means at their disposal to determine the relative offsets between singly drizzle images. In some cases, a stellar field for example, it might be more appropriate to carefully measure the position of individual stars in each frame for example. No matter what method is used, the end result, if the relative offsets are measured between singly drizzle images produce by MultiDrizzle, should be entered in a file similar to the file shifts.F190N shown above.

When the `driz_separate' step is run for the second time, but with a `shiftfile' specified, the association table for the data set will be automatically updated. To confirm that the new separately drizzled images are appropriately registered, cross correlation using crossdriz could again be examined. It is also useful to create a median image and examine the width and shape of the PSF (if stars are present in the image) over the entire FOV to look for any effects of mis-registration. Median combination is performed in Step 4.The content of the ASN table after running MultiDrizzle with the shiftfile shown above is:


Table 6.7:
MEM-
NAME
MEM-
TYPE
MEM-
PRSNT
X
OFFSET
Y
OFFSET
X
DELTA
Y
DELTA
ROTA-
TION
SCALE
N3UV01ALQ
EXP-DTH
yes
0.
0.
0.3194
-0.0148
0.
0.
N3UV01AMQ
EXP-DTH
yes
0.
0.
0.1354
0.1049
0.
0.
N3UV01ANQ
EXP-DTH
yes
0.
0.
1.0E-4
-3.0E-4
0.
0.
N3UV01AOQ
EXP-DTH
yes
0.
0.
0.1395
-0.1362
0.
0.
N3UV01020
PROD-TARG
yes
0.
0.
0.
0.
0.
0.

Default ASN table of the F190N NICMOS images used in example

6.3.8 Step 4: Create Median Image

Figure 6.15: Image of the EPAR Window for the Fourth Drizzle Step


 
STEP 4
 

When `median=yes', this step creates a median image from the separate drizzled input images, allowing a variety of combination and rejection schemes. If `combine_type' is set to `median', then the routine carries out a similar calculation to the standard IRAF task imcombine, with equivalent behavior for the parameters `combine_nlow' and `combine_nhigh' (the number of low and high pixels to reject), and `combine_grow' (the amount by which flagged pixels can grow). All imcombine parameters other than those specified above are reset to their default values.

If `combine_type=minmed', a more sophisticated algorithm is used to combine images. The basic concept is that each pixel in the output combined image will be either the median or the minimum of the input pixel values, depending on whether the median is above the minimum by more than n times sigma. An estimate of the "true" counts is obtained from the median image (after rejecting the highest-valued pixel), while the minimum is actually the minimum unmasked ("good") pixel. This algorithm is designed to perform optimally in the case of combining only a few images (3 or 4), where triple-incidence cosmic rays often pose a serious problem for more simplified median combination strategies. The `minmed' algorithm performs the following steps:

The last step is very successful at flagging the lower signal-to-noise "halos" around bright cosmic rays which were flagged in the first pass.

If `median_newmasks=yes', then the singly drizzled weight maps (`*_single_wht.fits') are used to create pixel masks for each image (with values 0 and 1) which are named `*_single_wht_maskhead.pl'. The IRAF task mask_head prepares the singly drizzled images by populating the header bad pixel mask keyword `BPM' for each image. These masks will be used by imcombine when combining images, where the assumed mask parameters are `masktype=goodvalue' and `maskvalue=1', indicating that pixels assigned a value of 1 are considered good.

If `median_newmasks=no', this task will use whatever masks are specified by the user (and which are created offline) in the `BPM' header keyword of each image. In general, however, it is recommended that the pixel masks which are generated by default are used instead.

Selecting the best parameters for the median step can be an iterative process and should always involve examination of the clean, combined product to verify that the majority of cosmic rays and other artifacts are successfully removed. The rejection algorithm which is ultimately chosen depends largely on the number of datasets being combined and the amount of overlap between dithered images.

In this example, we have chosen the default parameters `combine_type=minmed', `combine_nlow=0', and `combine_nhigh=1'.

This median image is shown (Figure 6.16):

Figure 6.16: The Median Combined NICMOS Image


 
The median combined image .
 

The vertical lines seen in the median image above are caused by the NICMOS quadrant boundaries. Since our dataset comprises several dithered observations, we can further improve this by using a static bad pixel map. This file must be a multi-extension file containing one extension named MASK. The simplest way to create such a file is to copy one of the original CAL files, rename the DQ extension and set all pixels to 1.0 except for the column near the middle of the detector. MultiDrizzle simply multiplies the input data by the content of the static bad pixel map. The latter should hence label good pixels with values of 1.0 and bad ones with values of 0.0.

One way within Pyraf to do this is:

  !cp n3uv01alr_cal.fits static.fits
 hedit static.fits[DQ] extname MASK update+ verify-
 import pyfits
 fin = pyfits.open("static.fits",mode="update")
 fin['MASK'].data[:,:]= 1.
 fin['MASK'].data[:,125]=0.
 fin['MASK'].data[:,126]=0.
 fin['MASK'].data[:,127]=0.
 fin['MASK'].data[:,128]=0.
 fin['MASK'].data[:,129]=0.
 fin.close()

The DQ extension of the static.fits file should look like this. This is the content of the 3rd extension in the static.fits file. The content of the other extensions, which are nevertheless required, is ignored:

Figure 6.17: The NICMOS Static Mask Image


 
The static mask image
 

Running MultiDrizzle after setting `static.fits' file, with parameters `combine_type=minmed', `combine_nlow=0', and `combine_nhigh=0', results in the following improved median file (Figure 6.18):

Figure 6.18: The Improved NICMOS Median Image


 
The improved median image using the static mask file.
 

6.3.9 Step 5: Blot back the median image

Figure 6.19: Image of the EPAR Window for the Fifth Drizzle Step


 
STEP 5
 

When `blot=yes', this task takes the median image and uses the dither package blot task to apply the geometric distortion and to transform (`reverse drizzle') it back to the reference frame of each of the original individual input images. This involves reversing the shifts and reapplying the geometric distortion that had been removed in step 3. In addition, the median image is resampled to the pixel scale of the original images and is trimmed to match the dimensions of each input image. This step is done in preparation for subsequent cosmic ray rejection in step 6. The blotted frames are named `*_sci?_blt.fits'. If desired, the user may wish to display the input images and blink them with their `blotted' counterparts. The `blotted' images should align perfectly with their respective input images and should be reasonably similar in appearance, except for the fact that they should be cleaned of cosmic rays and other defects.

6.3.10 Step 6: Remove Cosmic Rays with DERIV or DRIZ_CR?

Figure 6.20: Image of the EPAR Window for the Sixth Drizzle Step


 
STEP 6 in the process
 

First, the deriv task uses the blotted median images (`*_sci?_blt.fits') from step 5 to calculate the absolute value of the difference between each pixel and its four surrounding neighbors.

These derivative images are used by the task driz_cr when comparing the original and blotted images. First, the original CAL images are compared with the corresponding blotted median image `*_sci?_blt.fits' and its absolute derivative to create a mask of cosmic rays (and other blemishes, like satellite trails). Where the difference is larger than can be explained by noise statistics, or the flattening effect of taking the median, or perhaps an error in the shift (the latter two effects are estimated using the image derivative), the suspect pixel is masked. cosmic rays are flagged using the following rule:

|data_image - blotted_image| > scale*deriv_image + SNR*noise

where `scale' is the user supplied driz_cr parameter listed above and is defined as the multiplication factor applied to the derivative before determining if the difference between the data image and the blotted image is sufficiently great to require masking. `Noise' is calculated using a combination of the detector read noise and the poisson noise of the blotted median image plus the sky background.

The user must specify a cut-off signal-to-noise (SNR) value for determining whether a pixel should be masked. Actually, two cut-off signal-to-noise ratios are needed, one for detecting the primary cosmic ray, and a second for masking lower-level bad pixels adjacent to those found in the first pass. After the first pass through the image, the procedure is thus repeated on pixels that are adjacent to previously masked pixels using a lower SNR threshold, since cosmic rays often extend across several pixels.

The final output is a cosmic ray mask file named `*_mask1.fits'. One of the resulting masks for chip 1 is shown and should be blinked with the original image (or the equivalent science file) to visually ascertain that all cosmic rays were flagged. If it appears that the central pixels of some stars were unnecessarily masked, the `driz_cr_scale' parameter should be increased. If not enough cosmic rays were masked out, this parameter should be decreased. In this example, the default `driz_cr_snr' values "3.0 2.5" were too stringent and resulted in flagging the centers of stars and the core of the Egg Nebula. Instead, we have increased the default SNR values to "4.0 3.0" to create ideal cosmic ray masks for this data set. If the `driz_cr_corr' option is set to `yes', the driz_cr task also creates a `*_cor.fits' image, where flagged pixels are replaced with pixels from the blotted median image. The cosmic ray mask files are then multiplied by the bad pixel masks (which are a combination of the image DQ array and the static masks) to create a final mask file for each input image, `*_mask1.fits', which will be used during final drizzle combination.

6.3.11 Step 7: Drizzle final Combined Image

Figure 6.21: Image of the EPAR Window for the Seventh Drizzle Step


 
STEP 7
 

When the following initial setup parameters are set: `build=yes' (default) and `context=yes' (non-default), the final output image will be a single multi-extension FITS file named `final_drz.fits'. This file contains the science image in extension 1, the weight image in extension 2, and the context image in extension 3. When `build=no', these files will be written to separate output files. When the default value `context=no' is used, no context image is created.

The first extension of the drizzled product contains the science (SCI) image which is corrected for distortion and which is dither-combined (or mosaiced), if applicable. 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 are computed on-the-fly and the default output plate scale is read from the `scale' column in the IDCTAB. These parameters, however, may be chosen by the user to best suit the actual data.

The second extension of the output image contains the weight (WHT) image. This image gives the relative weight of the output pixels and, in standard processing using the defaults, it can be considered an effective exposure time map. The weight image from the example is shown, where darker areas have lower weight. The chip edges are clearly visible, as are column defects and cosmic ray features. The bulk of the image is "white" corresponding to the overlap of all six inputs. In this area the weight value is ~1160, equal to the sum of the exposure times of the six images which contribute.

If the option `context' was set to `yes', the third extension of the 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 is extended as a cube with additional 32-bit deep planes as required to handle all the input images. As there are four input images, this image has 4 bit planes which may be set. The darkest area shown corresponds to the area with all four inputs and hence has all the following even bits set: 1+2+4+8=15. cosmic ray hits or other defective pixels contribute to the appropriate bit plane with zero weight and hence appear as lighter spots.

6.3.12 Other Filters

The tutorial above can be repeated using the following shift file for the F165M filter data:

  # units: pixels 
 # frame: input
 # form: delta
 n3uv01b3r 0.0006   -0.0000    0.00   
 n3uv01b2r 0.0       0.0000    0.00 
 n3uv01b6r 0.1955   -0.3277    0.00   
 n3uv01b4r 0.0554   -0.2480    0.00  

and the following shift file for the F212N filter data:

  # units: pixels 
 # frame: input
 # form: delta
 n3uv01b3r 0.0006   -0.0000    0.00   
 n3uv01b2r 0.0       0.0000    0.00 
 n3uv01b6r 0.1955   -0.3277    0.00   
 n3uv01b4r 0.0554   -0.2480    0.00

6.3.13 Examining the Results

The following shows the content of the F190N MultiDrizzle result (Figure 6.22):

Figure 6.22: The Final Drizzled Nicmos Image


 
The F190N MultiDrizzle result.
 

The second extension of the example_drz.fits file generated by MultiDrizzle contains the weight map (Figure 6.23):

Figure 6.23: The Weight Image for the Final Drizzled Nicmos Image


 
The weight map that has been generated by MultiDrizzle.
 

If a context map is generated, it is available in the third extension of the MultiDrizzle output (Figure 6.24):

Figure 6.24: The Context Map for the Final Drizzled Nicmos Image


 
The context map that has been generated by MultiDrizzle.
 

The other images, assembled using the F165M and F212N data, are shown below:

Figure 6.25: The Final Drizzled F165M Image


 
The F165M MultiDrizzle result.
 
Figure 6.26: The Final Drizzled F212N Image


 
The F212N MultiDrizzle result.
 

Finally, a color composite using all of the available data can easily be created using a program such as Stiff:

Figure 6.27: A Composite Color Image of all the Final Nicmos Images


 
A color composite using the F165M, F190N and F212N images created above.
 

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