Dark Frame Calibration

Every camera sensor produces a certain amount of dark current, which accumulates in the pixels during an exposure. The dark current is produced by heat; high-performance cameras cool their sensors to minimize this effect. Unfortunately this is not an option with typical DSLRs and low-cost cameras.

The main problem with dark current is that it accumulates at a different rate in every pixel. Some pixels are "hot" and others are "cold". Unfortunately there is usually a spattering of pixels that are especially hot, which degrade the image a great deal. Fortunately, the effect of hot and cold pixels can be easily removed by subtracting a dark frame.

A dark frame is an exposure taken under the same conditions as the light exposure, but with no light striking the array. Since each pixel is consistent in its dark current at any one temperature, the dark frame can be subtracted from the light frame to remove the fixed pattern from the image. For most sensors this produces a striking improvement in the image.

Unfortunately, while the rate of dark current is constant, the actual accumulation of dark current is random. Anything that is random in imaging is noise, which is the enemy of sensitivity. Doubling the dark current increases the random noise produced by the square root of 2 (approximately 1.414). This means the hot pixels produce significantly more noise. Since the noise is random and therefore unpredictable, it cannot be removed; in some calibrated images they will be brighter than normal, and in others they will be darker than normal. You can improve the hot pixels, but you cannot completely fix them.

So subtracting a dark frame eliminates noise, because it gets rid of the gross pixel-to-pixel variations in dark current. Unfortunately, and perhaps counterintuitively, subtracting a dark frame also adds noise to the image. Every pixel has random read noise, plus the residual dark current noise. This noise does not subtract, but rather adds in a root-sum-square fashion. Therefore simply subtracting one dark frame increases the noise level 41%. The way to get rid of this noise is remove it by averaging multiple dark frames. Every time you quadruple the number of averaged frames, you drop the noise contribution in half.

Suppressing Hot Pixels

Although you can greatly improve the hot pixels by calibration, there will still be a residual speckle of hot and cold pixels in the image. That does not mean you have to live with them; there are ways to suppress the effects of hot pixels.

One way is to simply replace them with the average of the surrounding pixels. In MaxIm DL the Kernel Filter command can remove them. A better way is to create a "bad pixel map" using the Remove Bad Pixel command, and fix up just the pixels known to be especially hot.

An ever better way is to ”dither” the pointing of the camera slightly between exposures, thus distributing the noise contribution of each hot pixel to a different position on the image, and then combine a number of images together using the median, Sigma Clip, or SD Mask algorithm, which will reject the hot pixel contributions altogether.

Dark Frame Scaling

The longer the exposure you take, the more dark current accumulates. This means that the dark frame and light frame must have the same exposure time in order for calibration to work. They must also be taken at exactly the same temperature as nearly as possible, because the rate of dark current accumulation varies strongly with temperature. Many high-performance cameras include coolers with high precision temperature regulation; this greatly simplifies management of the dark frames.

Of course, DSLRs and low-end cameras do not have temperature regulation. If the temperature changes, the dark frame will no longer work. It is common in astronomical applications for the temperature to drop as the night progresses. Taking dark frames throughout the night minimizes the differences, but this can lead to situations where a dark frame is not available to properly calibrate an image.

So what can you do if you do not have a calibration frame that matches the exposure duration and/or temperature of an image? Dark Frame Scaling is the answer. Use a dark frame whose temperature and exposure duration are as close to correct as possible, and configure the Set Calibration command to perform scaling. Using a bias frame is strongly recommended in this situation (bias is constant and does not scale with exposure time).

There are two types of automatic scaling available: Auto Scale and Auto Optimize. Auto Scale will adjust the scaling based on the exposure times listed in the FITS header. This is useful for situations where the exposure time changes, but the temperature does not. If exposure time information is not available, or the images were taken at different temperatures, the Auto Optimize algorithm with perform an iterative adjustment of the scaling until the noise is minimized.

If you do have a temperature-regulated camera, you can take a set of ”master frames” at various temperature settings and exposures. These can be used to calibrate any matching exposure taken with the same camera. Dark Frame Scaling can then be used if an exact match is not available. If you enter multiple sets of calibration frames into Set Calibration, MaxIm DL will automatically choose the frames that best match the exposure conditions.

Some users just take a single set of long dark frame exposures and use the exposure compensation feature for shorter light exposures. Most CCD sensors are highly linear, so this technique works very well.  Scaling is often not suitable for CMOS sensors, especially when using HDR or in-camera stacking modes.