Creative Commons License Copyright © Michael Richmond. This work is licensed under a Creative Commons License.

Using AstroImageJ to make "master" darks and flats


The dataset

You will be analyzing a set of images which were taken at the RIT Observatory back in 2015. In order to carry out the procedures in this exercise, you'll need to copy the images to a local folder on your computer. So, please begin by creating a folder with the following name:

You can now download the images you'll be examining in today's lab. The quickest way to do that is to download this file, which is a ZIP archive.

Place the zip file into the raw folder and extract all the files from it. You should see a total of 39 FITS images:

darks1_v_jun23-001.fit  darks1_v_jun23-014.fit  flats_v_jun23-007.fit
darks1_v_jun23-002.fit  darks1_v_jun23-015.fit  flats_v_jun23-008.fit
darks1_v_jun23-003.fit  darks1_v_jun23-016.fit  flats_v_jun23-009.fit
darks1_v_jun23-004.fit  darks1_v_jun23-017.fit  flats_v_jun23-010.fit
darks1_v_jun23-005.fit  darks1_v_jun23-018.fit  flats_v_jun23-011.fit
darks1_v_jun23-006.fit  darks1_v_jun23-019.fit  flats_v_jun23-012.fit
darks1_v_jun23-007.fit  darks1_v_jun23-020.fit  flats_v_jun23-013.fit
darks1_v_jun23-008.fit  flats_v_jun23-001.fit   flats_v_jun23-014.fit
darks1_v_jun23-009.fit  flats_v_jun23-002.fit   flats_v_jun23-015.fit
darks1_v_jun23-010.fit  flats_v_jun23-003.fit   flats_v_jun23-016.fit
darks1_v_jun23-011.fit  flats_v_jun23-004.fit   flats_v_jun23-017.fit
darks1_v_jun23-012.fit  flats_v_jun23-005.fit   flats_v_jun23-018.fit
darks1_v_jun23-013.fit  flats_v_jun23-006.fit   flats_v_jun23-019.fit

As a check that the files have been transferred properly, run AstroImageJ and open the file called darks1_v_jun23-001.fit. It should look something like this:


Building a master dark frame for 1-second exposures

There are 20 images with exposure times of 1 second, each taken with the lens cap covering the front of the telescope. These are "dark" frames. In theory, they should be empty, with all pixels values zero, since no light reached the camera. However, if you examine them, you'll see that their pixels are most definitely not zero.

Display the first in the set, darks1_v_jun23-001.fit. Examine it carefully. How much do the pixel values change from one side of the image to another? How large is the random scatter from one pixel to the next?

The plan is to subtract the "dark current" shown in these 1-second dark images from a set of 1-second flatfield frames; but, as you can see, these individual dark images are pretty noisy. We could create a less noisy version of the 1-second dark current by combining a set of individual 1-second exposures. Here's how to do that.

In the image window, Process -> Data reduction facility .... The "CCD Data Processor" window will appear. We will give it a list of images to process, and tell it that it should "Build" a master dark image. Fill in the portions of the window shown below -- but replace the name of the folder in the "Filename Pattern Matching" box with the name of the folder on your computer which contains the raw images.

(Note that we choose the median option, rather than the average, when we create the master dark frame)

Click on the "START" button at the bottom to bring the procedure. After a short time, two new windows should pop up: a "Log" window should pop up, with a list of the operations it has carried out, and a new image window.

There should now be a new image in your folder, with the name master_dark1.fit. Open this image in a new window, and compare it visually to one of the raw 1-second dark images.

Is the "master" dark frame more or less noisy than an individual dark frame?


Building a master flatfield frame

In addition to correcting for the "dark current", we'd also like to remove any variations in sensitivity across the focal plane. A perfect telescope and camera would respond to light equally in all locations ... but real telescopes tend to concentrate more light at the center of the image, and real cameras often suffer from the shadows of dust particles. In order to remove these effects, we create "flatfield images" by pointing the telescope at a blank white card, or a region of the sky at twilight. The result OUGHT to be a uniformly lit picture; we can use any deviations to gauge the sensitivity of each pixel, and remove it later.

On this night, I took pictures of the sky during twilight. It was still too bright to show any stars, so the pictures should be uniformly bright. Let's take a look at one. Open the image called flats_v_jun23-001.fit. It should look something like this:

In addition to the big systematic variations you can see easily, this image contains also contains random pixel-to-pixel variations. When we divide our target images by the flatfield frame, those random variations would introduce a source of noise into our measurements. So, in order to make a less noisy flatfield frame, we can combine ten individual 1-second flatfield frames to create as "master" flatfield frame.

Note that we ought to subtract the 1-second master dark frame from each individual flatfield image first, and THEN combine them.

Fortunately, AstroImageJ's "CCD Data Processor" window can do all this work for us. Open the window again, if necessary, and enter information as shown below. Again, replace the folder name in the Science Image Processing box with the appropriate folder on your computer. Note how we've modified the entry in the Dark Subtraction box from "Build" to "Enable"; that means that the master dark will be subtracted from each raw flatfield frame first, before they are all combined. Once again, we have chosen the median, rather than the average, when combining the images.

Click on the "START" button to create the master flatfield frame, which should have the name master_flatv.fit.

After the "master" flatfield image has been created, display it side-by-side with one of the raw flatfield frames. Do you see any differences?


For more information


Creative Commons License Copyright © Michael Richmond. This work is licensed under a Creative Commons License.