Shifting and Adding



next up previous
Next: About this document Up: Data Reduction Previous: Flat Fielding Dithered

Shifting and Adding

So, you've finally produced bias subtracted, flat-fielded images. If you were doing optical data reduction, you'd be finished by now. Unfortunately, each image is only a one minute or so exposure; you may have to add dozens of different frames up to produce a final, sensitive image of your target. And you can't just add the frames together as they are; you have to shift them so that all the stars line up.

Experience shows that, at least with Australian telescopes, the process of working out by how much the images need to be shifted to line them up needs to be partially manual. The telescopes do not offset precisely enough to allow you to align the images automatically (though Bruce Peterson is still trying...). You will have to look at all the individual images, and use a cursor to track the position of some star in them all. You can then feed this into some software package which will work out accurate offsets, shift the images, and combine the shifted images. The details depend on the software package in use; I describe the procedure I use in IRAF below.

This sounds (and is) very time consuming; you have to look at each individual image and measure the position of a star within it. However, experience suggests that this is very valuable for picking up stray problems; funny bias patterns, satellite trails, reflected moonlight. If a few of your frames are bad, just leave them out of the final sum.

One puzzle is what to do with the outer regions of your image. Depending on the dithering pattern used, there will be a central region of your image which was seen in each of the individual frames. As you move further out, only some of the individual frames will have looked at a given bit of the sky. This means the signal-to-noise ratio will decrease towards the edges of the image; something to be careful about when analysing your data later.

When you have your individual frames lined up, you have to average them. Doing a straightforward average maximises the signal-to-noise ratio, but is very sensitive to dud pixels etc. I usually median the frames instead. This reduces the signal-to-noise ratio slightly, but it also removes all the spurious features very nicely. You might want to try both and see which you prefer.

The following IRAF technique is messy and cumbersome; IRAF wasn't really designed with IR reduction in mind. Recent IRAF releases have much more powerful ways of doing this. However, this method works on even very old versions of IRAF, and it does an excellent job. With practice I can reduce a 20-frame image in about 25 minutes.

You start with a whole series of processed images, dithered around on the sky in some pattern. Make up an ASCII file listing all the image names in a column, list.d. Bring up an image display (SAOIMAGE or ximtool), and use the imexamine command to look at all the images in succession.

imexamine @list.d

Choose one of the images as a reference image (usually the first). In imexamine, use the `a' key to measure the centroid of all reasonably bright point sources in the field, and enter their x and y coordinates (in pixels) into an ascii file, one pair of x and y numbers per line. These stars will be used by the alignment software to line up the images.

Now choose one star, preferably a nice bright isolated one, that can be seen in all the individual frames. Measure its x and y coordinates in the reference image, and then use the `n' key in imexamine to bring up the next image from the list. Measure the position of the same star in the next image, using the `a' key again. Subtract the new position from the reference star position to generate the offset, and enter this into an ascii file for each frame (it will be `0. 0.' for the reference frame, of course). Do this for all the frames that make up an individual image.

You are now ready to use the imalign task to line up all the images. Edit the parameters of this task (using epar) to tell it the file in which you listed the offsets, and the star positions in the reference image. This program then measures accurate offsets, using your values as a starting point, and shifts the individual images until they are aligned. You then finish the job with the imcombine command.

One complication; imalign trims off the edge of the images; the bit that doesn't overlap with the reference image. This missing outer bit generally has a low signal-to-noise ratio, as only a few individual frames are contributing to it, but despite that it is often useful. Including this extra bit takes a little more work.

Create a set of images twice the size of your individual data frames using the magnify command. Set their pixels to a large negative number everywhere. Now copy (using imcopy) each of your individual data frames into the central region of one of these new larger images. These new larger images will now have your data in the middle of each, surrounded by a margin willed with large negative pixel values.

You can now align and combine these, as described above. Set imcombine's lower threshold to be above the large negative value, and when you do the final combining all these margin regions will be ignored, leaving you with the full image, properly calculated.



next up previous
Next: About this document Up: Data Reduction Previous: Flat Fielding Dithered



Michael Brown
Fri Mar 1 15:11:46 EETDT 1996