Welcome aboard the Sparrow STAR Liner! A blog where we take a trackless voyage across Space, Technology, Aviation, and other Randomness. Stops are scattered, and we do not have many stations, but we hope you enjoy where you disembark.
Astronomical CCD Image Preprocessing
Astronomical data, including pictures and spectra, are often done on a charge-coupled device (CCD) array. The data that comes from a CCD camera is considered raw data, it has many systematic artifacts like hot pixels, dark current, and bias to name a few. We remove these systematic artifacts using standard array preprocessing procedures.
We use preprocessing calibration images to remove these artifacts. These images are taken before hand. Often using archive calibration files are more than satisfactory and avoid the need for the taking of calibration images for each science image. A set of preprocessing image files are only good for a specific telescope, filter, and detector set. Changing any of these requires the taking of a new set of calibration images.
Required Calibration Images
In order to remove many of the systematic effects, sets of calibration images must be taken. We detail them here. Multiple images for each given type should be taken to average out random effects like cosmic rays.
Images for the Bias Frame
The bias frame is an image taken without any exposure time. It also does not have any exposure to light. The whole point of a bias frame is to capture the detector’s inate zero point, similar to tareing a scale.
To take a bias frame, take an image with zero exposure time and with the shutter closed (or similar).
Images for the Dark Frame
The dark frame is an image taken without any exposure to light with some exposure time. The whole point of a dark frame is to calculate the dark current of the detector to remove its effects from the image. The dark current is signal which is generated by detector based sources (like electronics) rather than the object of study.
To take a dark frame, take an image with a non-zero exposure time and with the shutter closed (or similar).
Images for the Linearity Function
In order to correct for linearity issues, flats over different periods of time are taken. The response of a CCD is not completely linear as with enough exposure the pixels begin to saturate. A linearity function helps correct for the non-linearity effect that saturation causes.
To take images to determine the linearity function, take multiple images at increasingly longer exposure times while exposed to a uniform light source.
Images for the Flat Frame
The flat frame is an image taken with exposure to a uniform source of light at some exposure time. The whole point of a flat field frame is to remove any per-pixel efficiency differences. The flat frame is uniformly illuminated so each pixel should have the same value (after removing the bias and dark effects).
To take a flat frame, take an image while exposed to a source of uniform intensity. Common sources include dome lights (dome flats), the twilight sky (twilight flats), or the dark sky (dark flats). You could reuse some of the linearity images with tame exposure times.
Computing the Frames
The frames should be computed in order as described here.
Averaging Images
Because multiple images were taken, but the frame themselves are just one, a way of combining the multiple images is required. There are many methods: mean, median, quartile-excluding averages, etc.
In general, the simplest and fastest method is to use a median function when combining the images pixel-by-pixel. The standard mean is highly susceptible to outliers like hot pixels or cosmic rays and thus are not suitable for this application.
An alternative method is to exclude the outlier points using a sigma-clipping filter. Depending on the number of images taken, excluding values from the median is a good suggestion. For the remaining values, the mean is the most efficient way of combining them as outliers have been excluded.
Whatever the method used, the averaging function to combine images is notated as , similar to a summation symbol. We use a custom symbol due to the method used for averaging each has their own strengths and weakness so we do not prescribe one.
Creating Bias Frame
The bias frame can be calculated from all of the bias images taken. It is calculated as:
Creating Dark Current Frame
Provided a set of dark images, both the dark current and the bias are the contributors to the signal. The dark current frame can be created from the dark images .
The total dark contribution to the dark images is where is the exposure time of the image. The bias contribution is . So,
And thus providing the per pixel dark current of the array as:
Creating Linearity Correction Function
For detector linearity, the total signal that a pixel records because of an exposure is from the light source, the dark current, and the bias. Considering the entire set of uniform light observations over time, . (Where we proxy exposure as time provided the constant and uniform light source which is being observed.)
The contribution of all three can cause the array to saturate so discriminating between them for linearity correction is not useful. Instead we take the images provided as and have:
And provided the observations, we have the data points to the average response function
TO DO UNDERSTAND
This linearity function corrects for the non-linearity in the detector.
Creating Flat Fields
Flat field images are commonly multiple images of a uniform field at constant exposure times. . They take out pixel-to-pixel variation (in their efficiency) in the array. As they are all exposed to a light source, the bias, dark current, and the actual light source contribute to the flat field images. So, the contribution from the uniform light source itself over the exposure time is given as:
As all of these images are exposed to a uniform and constant light source, they should all have the exact same pixel value. Deviations from a singular constant value indicate pixel-to-pixel variation. The relative variation across the array is thus given by:
(Where determines the average pixel value in a single array in a manner similar to combining and averaging multiple arrays. Taking a median is the most common.)
All of the many normalized flat fields can then be further combined into a single flat field:
Preprocessing Data
After all of the different calibration frames have been derived, any raw science image can be preprocessed to a reduced image . The reduction process to remove unnecessary signal contribution like bias, dark current, and pixel-to-pixel variation is given by:
This reduced science image is what should be used for further analysis.
References
A lot of this information is taken from:
Chromey, F. R. (2017). To measure the sky: An introduction to observational astronomy.
Created: 2025-12-28
Last Updated: 2025-12-28