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.
In order to remove many of the systamtic 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.
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).
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).
In order to correct for linearity issues, flats over different peroids of time are taken. The responce 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.
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 effeciency 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.
The frames should be computed in order as described here.
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 simplist and fastest method is to use a median function when combining the images pixel-by-pixel. The standard mean is highly susceptable to outliers like hot pixels or cosmic rays and thus are not sutiable for this application.
An alterntve method is to exclude the outliar 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 effecient 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.
The bias frame can be calculated from all of the bias images taken. It is calculated as:
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:
For detector linearity, the total signal that a pixel records because of an exposure is from both 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 observatios, we have the data points to the average responce function
TODO UNDERSTAND
This linearily function corrects for the non-linearity in the detector.
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 reletive 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:
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 unnessasary 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.
A lot of this information is taken from:
Chromey, F. R. (2017). To measure the sky: An introduction to observational astronomy.