Calculating Gain Read Noise and

advertisement
Mark Shelley
30 Oct 2012
www.markshelley.co.uk/Astronomy
How to Calculate Read Noise, Gain and Dark Current for a DSLR
This methodology relies on the fact that photons are captured by the pixels on a CCD or CMOS sensor
as what is known mathematically as a Poisson process. If you take an image of a uniformly illuminated
object then the pixels values from the sensor will not all be identical – instead they will have a
statistical distribution having a mean and variance (variance is the square of standard deviation). The
pixel values are essentially a count of the captured photons but they will be scaled – this scaling is the
gain, measured in electrons/ADU (analog-to-digital unit) or DN (digital number). For a DSLR this
gain will depend on the selected ISO.
It so happens that for a Poisson distribution, the mean and variance are identical. But reading the pixel
values from the sensor is not precise – there is an additional source of randomness known as the read
noise.
image_variance = (image_mean + read_noise*read_noise) /gain
We can determine the gain and RMS (root mean square) read noise by taking a number of shots where
the mean and variance change and then plotting a graph.
The procedure is as follows:
1) Choose an ISO for the experiment – ISO 800 is a good choice and put the camera in manual mode
with a fixed lens aperture. It is important to shoot raw frames.
2) Take two dark frames (with the lens cap on) at the highest shutter speed – generally 1/4000s
3) Now remove the lens cap and take a series of shots in daylight pointing at a uniformly illuminated
sheet of white paper out of focus. Don’t do this in artificial light which is flickery and so
illumination can change from shot to shot. The shots we want are:
4) Two identical frames at 1/4000s, 2 identical frames at 1/2000s, 2 frames at 1/1000s, continuing on
until you are near saturation point.
5) Using IRIS or your chosen astro-processing package, load up the raw frames and extract the green
channel from each one – the IRIS command “split_cfa c1 c2 c3 c4” will do this. C2 is usually the
green channel. It is important to do this before the RGB image is generated because an RGB
image contains interpolated pixels. If you select the green channel of an RGB image then the
interpolated pixels will upset the standard deviation calculations below.
6) Load up the green channel of one of the 2 dark 1/4000s frames and calculate the mean (or average)
of an area in the centre of the frame. Now subtract the green channels one from the other with an
offset to keep the results positive and calculate the standard deviation (also known as Sigma) of the
pixels in the same central area of the frame. Enter the mean and standard deviation in the correct
row of the spreadsheet – the blue columns.
7) Now do the same thing for the two 1/4000s light frames and enter the mean and standard deviation
in the relevant row of the spreadsheet – the blue columns.
8) Continue doing this for each pair of frames taken at all the different shutter speeds.
9) On the spreadsheet the graph is plotted of mean against variance. This should be more or less a
straight line whose slope is the gain. The slope is also calculated in the column “Gain”. The gain
might jump around a bit for the first few rows but will then stabilise to a certain level. Enter this
gain number into the blue cell called “Gain” and then the read noise will be calculated and
displayed next to it.
As a point of interest, the reason this experiment is performed using pairs of frames is that when you
subtract two frames you also subtract any coherent patterns, hot pixels, other pixel non-uniformity and
noise that might otherwise bias the results.
Now we have the Gain (measured in electrons/ADU) and the standard deviation of the Read Noise
(measured in electrons) we can calculate the dark current. The camera should be left switched off
Using the same ISO that you used for the gain and read noise “experiment”, with the lens cap on and at
room temperature, take a continuous sequence of 25 darks over 2 hours with an exposure time of 5
minutes each. Again, it is important to shoot raw frames. If the camera has a rear LCD then switch it
off because it generates extra heat. The camera should ideally be in a darkish place to help prevent
light leakage through the viewfinder.
Firstly, on the “Dark Current” sheet of the spreadsheet enter the gain and read noise that you calculated
earlier.
Using IRIS or your chosen astro-processing package load up the raw frames and do the following:
1) Subtract frame 1 from frame 2 with an offset to keep the numbers positive and calculate the
standard deviation. Enter this in the relevant row of the spreadsheet. Note that it is not necessary
to separate the green pixels because all pixels behave equally in the dark!
2) Subtract frame 2 from frame 3 with an offset to keep the numbers positive and calculate the
standard deviation. Enter this in the relevant row of the spreadsheet.
3) Continue as above until you subtract frame 24 from frame 25.
The spreadsheet will calculate the dark current (in electrons/second) and will plot a graph. Notice how
the dark current climbs rapidly at first as the sensor heats up and then reaches a plateau.
If you perform the same experiment with a cold camera – e.g. in a fridge, you’ll notice the dark current
is much lower.
Download