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

Analyzing dark frames from Sep 25, 2003

On UT Sep 25, 2003, we placed the SBIG ST-9 CCD camera onto the 16-inch telescope and acquired a set of "dark" images -- that is, images taken with the shutter closed. In theory, these images should show nothing. But in practice, dark frames do contain something: noise, due to thermal motions of silicon with the chip's lattice. In order to remove this noise from a real image, one must first understand its properties.

Today, you will

Getting ready

Here's what you need to do:

  1. log into the computer
  2. start an "XMing" session -- see the notes from the previous lecture if you can't remember
  3. in the terminal window for spiff, log in
  4. go to your own directory, like this:
                   cd richmond
    Make sure that the prompt now has your name in it!
  5. initialize the image display by typing

Today, we'll be examining some data that I acquired at the RIT Observatory quite a while ago. You'll need to make copies of these raw images for your own use, so type this: that you have all the files you need for today. At the command prompt, type

         cp $dd/sep24_2003/* .

When you have reached this point, please pause, and look around. If someone nearby is having problems, please help him or her to reach this point.

Examining the dark current in images taken on Sep 24, 2003

Use the Linux ls command to verify that you have all of the following:

The first set, with names like dark1-, were taken with the CCD chip at a warm temperature: T = 23 Celsius. The second set, with names like dark1cold-, were taken after the chip was cooled to T = -19 Celsius.

Use the tv command to display images in the "warm" series:

  1. What can you tell about this series of images by just looking at them, and moving the cursor around on the images?

Define a box

Display the 1-second dark image. Then type the command

         box 1 int
You will be told to define a box by clicking and dragging ...

Make a box in the center of the image, roughly one-quarter of the image width by one-quarter of the image high. If you screw up or don't like the box you get, just repeat the command. When done, you should be told exactly where your box is:

If you now type the command

         box 1 show
the box you have just defined should appear on all open image windows. It may disappear if the window is closed and reopened, or covered and uncovered.

Boxes are useful to define subsections of images. It's often a good idea to isolate a small section of an image for statistical purposes.

Computing image statistics

There are several commands for calculating statistics of entire images, or subsections of images. The mn and abx commands produce similar information

but the abx command is a bit more verbose.

  1. Use the mn command to calculate the mean and stdev of pixel values within your box in the 1-second warm image Write down the result.
  2. Repeat the measurements on other warm images: a 10-second image, a 20-second image, a 30-second image. Again, write down the results, making a small, neat table.
  3. Plot your data on the graph paper provided. Place exposure time (in seconds) on the horizontal axis, and mean pixel value (in counts) on the vertical axis.
  4. Determine the slope and y-intercept of the line defined by your measurements. Explain the units and meaning of the slope, and the units and meaning of the y-intercept.

When you have reached this point, please pause, and look around. If someone nearby is having problems, please help him or her to reach this point.

Making histograms of pixel values

The mean and stdev are nice, but they don't always tell the whole story. You can learn more about the properties of an image by making a histogram of pixel values; that is, finding out exactly how many pixels have a value of 100 counts, how many with 101 counts, how many with 102 counts, etc. You can use the command hist to do the job for you, like so:

      hist box=1
By running this command on an image, you will create a data file which has the same name as the image, but with an extension of ".his" instead of ".fit".

What does this ".his" file contain? A simple 2-column list of data, in which the first column represents a pixel value, and the second column the number of pixels in the image (or sub-image) which have that value. You can look at the values with the Unix command more:

But you can understand this more simply by making a graph. There's a very nice program for plotting scientific data called gnuplot. You can run it by typing


Just follow the example below to create a histogram of the number of pixels with each value.

[phys445@spiff richmond]$ gnuplot

        G N U P L O T
        Version 4.2 patchlevel 4 
        last modified Sep 2008
        System: Linux 2.6.28-18-generic

        Copyright (C) 1986 - 1993, 1998, 2004, 2007, 2008
        Thomas Williams, Colin Kelley and many others

        Type `help` to access the on-line reference manual.
        The gnuplot FAQ is available from

        Send bug reports and suggestions to 

Terminal type set to 'wxt'
gnuplot> set term x11
Terminal type set to 'x11'
Options are '0'
gnuplot> plot 'dark1-001d.his' using 1:2

  1. Run the hist program on one each of the 1, 10, 20, 30 second warm images
  2. Make a graph of the distribution (using whatever software you wish)
  3. Describe each graph. Do you see any common features?
  4. Do the statistics "mean" and "stdev" describe this distribution accurately? Explain.

The importance of temperature

Okay, you should know quite a bit about the warm images now. The camera had a temperature of around 23 degrees Celsius during these exposures. But we also took a set of images at a temperature of around -20 degrees C. Do the images look any different?

  1. Display side-by-side one of the 30-second warm images, and the 30-second cold image.
  2. Aside from the mean level of each image, do you see any obvious differences in the appearance of the two images?
Is the "dark current" any different in the cold images?

  1. Using the same box as before, measure the mean and stdev of pixel values in the 1, 10, 20, 30 second exposures of the "cold" series.
  2. Graph these data on a second piece of graph paper
  3. Determine the slope and y-intercept of these data
  4. Compare the slopes and y-intercepts of the "warm" and "cold" series

Now use the hist program to examine the distribution of pixel values for the "cold" images.

  1. What features do you see in these distributions?
  2. Do the "warm" and "cold" distributions look similar or different? Explain.

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