You have learned that the number of counts in each pixel tends to rise linearly with time, due to electrons knocked free in the silicon lattice. When we take pictures of real celestial objects, we want to remove this "dark current" so that it doesn't contaminate our measurements of the brightness of stars. But how can we do that?

Consider the 1-second warm dark frames: ` dark1-001d.fit,
dark1-002d.fit, dark1-003d.fit. `
We want to get rid of the thermal contribution.
Maybe we can just find the mean value, and subtract that.

- Make a copy of the image
`dark1-001d.fit`for trial purposes:cp dark1-001d.fit test.fit

- Measure the mean and standard deviation of pixel values
in this dark frame. Write them down.
- Measure the mean value in image
`dark1-002d.fit`. Suppose that it is 210 counts. - Subtract this value from all pixels in the test image
like so:
sub test.fit const=210

where you substitute your actual measured mean value for the "210" above. - Now measure the mean and standard deviation of the
`test.fit`image, after the mean value of another dark frame has been subtracted. How does the new mean value compare to the original mean value? How does the new standard deviation compare to the original mean value? - Display the
`test.fit`image, and look at it critically.

We hope to see a subtracted image which has values of exactly zero everywhere. How well did this idea work?

Okay, that wasn't so great. Maybe it would be better to work on a pixel-by-pixel basis. Let's try subtracting one image directly from another:

- Make a copy of the image
`dark1-001d.fit`for trial purposes:cp dark1-001d.fit test.fit

- Subtract the image
`dark1-002d.fit`from the test image like so:sub test.fit dark1-002d.fit

- Now measure the mean and standard deviation of the
`test.fit`image. How does the new mean value compare to the original mean value? How does the new standard deviation compare to the original mean value? - Display the
`test.fit`image, and look at it critically.

Is this result all zeroes? Is it better than the first attempt? Can you be quantitative?

If you look carefully, you should see at least one pixel which is way, way, way above zero. Hint: consider changing the contrast of the image like so:

tv test.fit z=0 l=200

- What is the location (row, col) of this pixel?
- What is its value in the subtracted image?
- How does this value compare to the standard deviation of pixel values in the subtracted image?

The problem is that every now and then, a
**cosmic ray** particle flies through the CCD detector
and knocks lots of electrons loose.
These events occur at random times and intervals,
so you can't predict them.
They are very hard to remove ...

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