STScI Logo

Hubble Space Telescope
DrizzlePac: Photometry Demonstration

AstroDrizzle: Aperture Photometry Accuracy

Image registration

We begin by performing an image alignment. This task is crucial to obtain accurate photometry. We create a text file with the names of the FLT images, one for each filter. We call them list_f606w and list_f814w. In what follows we explain the registration method with filter F814W only. We work within the Pyraf environment:

> pyraf

The task AstroDrizzle (AD) (the main task within the software package DrizzlePac) differs from MultiDrizzle in the handling of the distortion model. AD handles different components as separate inputs: polynomial coefficients, column corrections for the CCDs, and non-polynomial offsets. The new task updatenpol updates the headers with new keywords and also appends several arrays as new extensions that contain the full distortion model.

--> import drizzlepac
--> unlearn updatenpol
--> epar updatenpol

This will open a new window called TEASL (Task Editor And Launcher) which is a user interface. This GUI allows the user to change parameters: For the task updatenpol we write:

input = @list_f814w
refdir = /your/path/to/reference/files/

This should run without any problems and the images are now ready for registration. We now use the new task tweakreg which computes residual offsets for a group of flat field-calibrated images. These offsets are incorporated into the images by updating their WCS information to match that of a reference image.

--> unlearn tweakreg
--> epar tweakreg

In the tweakreg TEAL interface, we modify the following parameters:

input = @list_f814w
conv_width = 3.5
threshold = 200.

The value conv_with = 3.5 is approximately twice the FWHM measured directly on several bright unsaturated stars using the IRAF task imexamine. The value threshold = 200.0 is much higher than the default, simply to choose the brightest objects for catalog matching.

tweakreg finds sources in each image and outputs catalogs. This should take a few seconds if you had set a high threshold. The code then matches the catalogs to a reference file (usually the first in the list: in our case j8ny02yuq_flt.fits)

When the matching is finished between the first two files, a window will pop up and show the residuals for the matched stars, and tweakreg will also output the residual shifts in X (XSH) and Y (YSH), the rotation angle (ROT) and the scale (SCALE). Also, the RMS values for the fitting are presented. One would expect to obtain an RMS lower than 0.05 in both X and Y for good alignment. This process might take several iterations and it is recommended to spend some time with this until a good registration is achieved.

tweakreg prompts the user to accept or reject the solution. If you are not happy with the solution, you may want to select different threshold values or even input your own list of sources for the catalog matching. In our case, using the above non-default parameters values we get very good RMS values and we accept the solution for both images. Figure 1 shows the residuals for image j8ny02z9q and Table 2 presents the catalog matching solutions for all F814W images.

Figure 1: Output plot from the task tweakreg showing the residuals in X and Y. These residuals are calculated by matching source catalogs between the reference image (j8ny02yuq) and the second image in our list (j8ny02z9q).


Dataset XSH YSH ROT SCALE XRMS YRMS
j8ny02yuq 0.000 0.000 0.000 1.000
j8ny02z9q -0.161562 0.118522 359.99992 1.000001 0.031426 0.030819
j8ny02zqq -0.249673 0.248745 359.99997 1.000007 0.032765 0.033977

Table 2: Output values of the catalog matching process for the F814W images. Estimated residual shifts in X (XSH) and Y (YSH), the rotation angle (ROT) and the scale (SCALE) are shown. The rotation angle is given in degrees; the residual shifts (XSH, YSH) are in units of pixels.

Once we are satisfied with the results, we re-run tweakreg with the following parameters:

input = @list_f814w
updatehdr = yes
conv_eidth = 3.5
threshold = 200.

This will update the headers' WCS in all images to have exactly the same orientation and the images are registered and ready for AstroDrizzle. Expect to run AstroDrizzle several times on your data, so it would be important to save copies of these files in a separate folder.