Shot noise from the light source, variations in sensitivity from pixel to pixel, thermally generated electrons, and hot pixels all degrade the signal to noise ratio of your spectrographs. The effect of shot noise can be reduced by taking several spectrographs of the same target and performing an ensemble average. Variations in the sensitivity of the pixels can be fixed by flat-field correction. Thermal current and hot pixels can be removed by dark frame subtraction.
Image noise can be described as coherent or non-coherent. Coherent noise has a pattern to it that will repeat in every photograph taken; for this reason, coherent noise is also known as fixed-pattern noise. Non-coherent noise is random. Assuming the noise is additive, coherent noise can be removed by capturing a frame that is only noise and subtracting it from a spectrograph.
Unfortunately the noise-only frame has random noise in addition to fixed-pattern noise. So while subtraction will remove the coherent noise it will actually increase the amount of random noise in the calibrated image. However, non-coherent noise can be reduced by adding several frames together then dividing by the number of frames used. This process of averaging data from multiple captures of the same signal is known as ensemble averaging. It works because the fixed-pattern reinforces itself with the addition of every frame while the random component tends to cancel itself out.
Ensemble averaging to reduce the effects of shot noise on a spectrograph’s SNR is the easiest of the techniques presented here. It simply requires that you take more than one spectrograph of the same target and combine them to get an image with a higher SNR. The more images you take the further the random noise will be reduced relative to the signal. If the signal to noise ratio of one image is λ/sqrt(λ) then the signal to noise ratio of the ensemble average is λ/(sqrt(λ)/sqrt(n)) where n is the number of images in the ensemble. In other words, since noise sums in quadrature the noise in an average of n images is reduced by the sqrt(n) compared to the noise in a single image.
The process of dark frame subtraction and flat-field correction is known as calibration. Please don’t confuse the methods mentioned here with spectral or radiometric calibration.
The intensity of a CCD’s pixel is determined by the number of free electrons created by incoming photons. However, it is also possible for free electrons to be thermally generated by the heat of the camera’s electronics and surroundings. These thermally generated electrons increase the noise present in an image. The longer the exposure or the hotter the CCD is the more thermal noise will accumulate. It’s fortunate that a component of this thermal noise called dark current repeats itself (i.e. it’s coherent) from image to image as long as the exposure time remains the same and the temperature of the CCD remains stable. A dark frame is an image where no light is allowed to strike the CCD. Thermal current (aka dark current) can be determined by ensemble averaging many dark frames together to create a master dark. Then a spectrograph’s thermal current can be removed by subtracting the master dark from it. Subtracting the master dark will also remove hot pixels.
Dark frames should be taken with all the same camera settings used to take spectrographs (aka light frames). Because a plastic lens cap can allow infrared light through, a second cap made from aluminum foil should be placed over it. The more dark frames you use to make a master dark the less random noise will be added to the light frame when you subtract the master dark from it. Don’t use in camera dark frame subtraction (noise reduction feature). It will add too much random noise because it only uses one dark frame. For some cameras, dark frame subtraction will always happen if the exposure time is greater than ~1 second. If the camera is hot, dark frame subtraction may even occur for exposure times less than 1 second. CHDK allows dark frame subtraction to be turned off.
Variations in the sensitivity of a CCD’s pixels and lens effects lead to an unequal distribution of light across a photograph even if the subject is a source of constant illumination (i.e. flat) in all directions. Vignetting is a well known result of lens effects producing an unequal light distribution. Flat-field correction removes these effects by dividing a spectrograph by a master flat. A master flat is created by taking photographs of a source of illumination that is constant across the field of view of the camera. A white ceiling or an LCD computer monitor with a diffuser are good sources of illumination for creating flat frames. Flat frames should be taken with all the same camera settings used to take spectrographs except for exposure time. The exposure time should be adjusted so that a flat frame’s histogram is between 1/3 to 2/3 full scale. If you are using a one-shot color camera it may not be possible to get the individual peaks of the red, green, and blue histograms to be between 1/3 and 2/3 full-scale if you are using a white light source to create the flats. However, if you are using an LCD monitor you can easily change the color displayed to one that looks gray to the camera and therefore has each of the RGB histograms’ peaks between 1/3 and 2/3 full scale. For example, a color that looks like magenta to me appears gray to my Canon PowerShot A590. See the article, RGB Flats for details on how to find the color that looks gray to your camera. A flat frame also has dark current so a set of darks must also be taken with all the same camera settings used to take the flat frames.
The camera’s white balance setting will affect the location of the RGB histograms’ peaks in JPEG images. Raw images do not have a white balance applied. Some cameras can be tricked into making all the white balance multipliers equal by setting a custom white balance on a bright target with a long exposure so that each color channel saturates. If the red, green, and blue multipliers are all equal this is equivalent to no white balance being applied.