# Thread: How man dark frames?

1. ## How man dark frames?

HOW MANY DARK FRAMES SHOULD I USE?
I've seen this question asked many times, and, the answers are always somewhat vague. No wonder, because, the answer depends on several factors that vary from user to user such as; Amount of Sky Glow (LP), Length of exposure, Camera Dark Current, etc.

I've created an Excel worksheet (see picture below) that takes all of the various factors into account, and, presents a graph showing the final stacked SNR for 2, 5, 10, 20, and infinite Dark Frames.

The vertical axis of the graph is the relative SNR for the stacked images from a nights data collection. The horizontal axis is Sub Frame Integration Time (in other words, how long is your exposure for each image). The actual SNR isn't important. What is important is that your choice of Sub Frame Integration Time and # of Dark Frames is maximizing your SNR.
In the picture below there are two dots on the graph.

1. The red dot indicates that collecting the data using a Sub Frame Exposure Time of 180 sec, and, processing the data with only 2 Dark Frames would yield a SNR of about 11.
2. If 20 Dark Frames had been used to process the same 180 sec Sub Frames data the light-blue trace shows the SNR would have improved to about 29, a significant improvement.
3. If the data were collected using 540 sec Exposures (rather than 180 sec Exposures) and 20 Dark Frames were used to process the data (the conditions for the blue dot) the SNR would be about 43.

Again, the absolute value of the SNR is not important. What is important is to understand that a higher SNR on the graph means a better final image (lower noise). For example, this allows you to determine whether or not you need to collect more Dark Frames.
The graph in the first image is for my camera/telescope and LP/filter conditions. Your graph will be determined by your camera/telescope/LP etc.

The worksheet (see picture below) requires data from 2 Bias Frames, 2 Dark Frames and 2 Light Frames (Light frames MUST be registered to each other) all taken at the same ISO setting on the camera (I used ISO 800 for my Canon T3). The Light and Dark frames need to have the same Exposure Time (I used 180 sec for my data).

Each pair of RAW frames were loaded into Pixinsight and subtracted using PixelMath to create a Difference image. The Statistics process was then used to measure the stdDev of the Difference image with the units in the upper left corner of the Statistics window set to 14-bit to match my camera RAW output. You would change this to match your camera output. The result of doing this for all three sets of images will be: StdDev(Bias1-Bias2), StdDev(Dark1-Dark2) and StdDev(Light1-Light2). These values are entered into the Excel worksheet.
In addition you need to enter:
Total time to collect data = the length of time you expect to be collecting data [time from the start of the first image till the end of the last image] (min).
t = the exposure time for the Dark and Light frames used to measure the StdDev.
Dither and Download time = the average time between the end of one image and the start of the next. Because of dithering and settling time there are about 60 seconds between my images.

If anyone is interested in the Excel worksheet just contact me with a PM and I'll be glad to send it to you.

Steve

2. ## The Following 2 Users Say Thank You to STEVE333 For This Useful Post:

ic_1101 (11-14-2018),kevin.mcde (11-14-2018)

3. ## Re: How man dark frames?

Nice job! Practically, as I have a cooled camera, I just turn it on, cool it down and take a bunch of dark frames overnight. I usually end up with about 30-50, but looking at your graph, 20 may be sufficienty.

4. ## The Following User Says Thank You to s24man For This Useful Post:

STEVE333 (11-07-2018)

5. ## Re: How man dark frames?

Originally Posted by s24man
Nice job! Practically, as I have a cooled camera, I just turn it on, cool it down and take a bunch of dark frames overnight. I usually end up with about 30-50, but looking at your graph, 20 may be sufficienty.
Thanks Stuart -

Because you have a cooled camera your Dark Current will be much lower than the Dark Current for my uncooled DSLR. That means the curves for your system (if you captured the Bias/Dark/Light frames and entered the data into the Excel worksheet) whould rise more sharply, and, be closer to the top (optimum) curve.

However, if 30-50 Dark Frames give you good results I wouldn't suggest changing. Nevertheless, I would expect that 20 Dark Frames would likely give nearly identical results.

Thanks for taking the time to respond. Sometimes I wonder if it is a waste of time to post these technical articles. Getting responses like yours encourages me to continue on.

Steve

6. ## Re: How man dark frames?

Good to know Steve. Dark frames can be a pain when shooting @ 300sec. I have been creating a collection based on sensor temperature. Iâ€™ve been setting the camera outside at night with byeos running and shooting for as long as the battery lasts. Now I know that once I hit 20 in my temp range I donâ€™t have to leave the camera out.

7. ## The Following User Says Thank You to madperk For This Useful Post:

STEVE333 (11-07-2018)

8. ## Re: How man dark frames?

Good to know Steve. Dark frames can be a pain when shooting @ 300sec. I have been creating a collection based on sensor temperature. I’ve been setting the camera outside at night with byeos running and shooting for as long as the battery lasts. Now I know that once I hit 20 in my temp range I don’t have to leave the camera out.
Remember that the curves shown are for my system. The curves for your system will almost certainly be different.

In other words, be careful about using the graph created from my data to make predictions for your system.

FYI - I also use BYEOS to control my camera. I put my camera in a plastic zip close bag and put it in the refrigerator for about an hour (camera turned off). Then I put the camera (still in the plastic bag) into an insulated lunch bag, turn on the camera, pack several "imitation ice" packs around the camera, and zip the lunch bag closed. I then start the BYEOS image capture with the desired ISO and exposure settings selected and let it run. By adding or subtracting "imitation ice" packs the temperature can be roughly controlled. In this way I was able to create 540 sec Master Darks with 20 or more dark frames covering the 50F - 73F temperature range over a span of three days. Since my camera runs about 10F warmer than the outside temperature, these Darks will work for outside temperatures of 40F - 63F which pretty much covers our temperature range. Below 40F I'm not sure I want to go out anymore, and, even in the summer it cools off in the evenings so that the upper temperature of 63F should work even in the summer.

Steve

9. ## Re: How man dark frames?

A little further explanation:

1) The Difference frame created by subtracting the two Bias frames allows the sensor Read Noise to be determined.

2) The Difference frame created by subtracting the two Dark Frames, along with the knowledge of the Read Noise allows the Dark Current Noise to be determined. This allows the Dark Current to be determined.

3} The Difference frame created by subtracting the two Light Frames, along with the knowledge of the Read Noise and Dark Current Noise allows the Sky Glow current to be determined.

4) Having Read Noise, Dark Current, and Sky Glow Current, the predicted SNR for any Exposure Time can be calculated.

5) The first three steps are pretty well know/documented in the literature. However, adding the effect of Dither and download time and of Dark Frame Noise is not something I've seen before.

6) Having Total time to collect data along with Sub Frame Exposure & Dither and download time the total number of exposures can be calculated.

7) The noise in the stacked images will be the noise is a single image / sqrt(total number of exposures).

8) The effect of the Dark Frame Noise is different. The noise in a single Dark Frame is

sqrt[(Read Noise)^2 + (Dark Current Noise)^2].

If there are N Dark Frames combined to create the Master Dark, then the noise of the Master Dark will be the (noise of a single Dark Frame) / sqrt(N).

9) Assuming a single Master Dark Frame is used to correct each Light image, when the Lights are combined (stacked) the Dark Frame Noise won't be reduced at all because it is the same in every Light Frame. Thus Dark Frame Noise can only be reduced by increasing the number of Dark Frames combined to make the master.

All of these calculations are included in the calculation of the graphs shown at the beginning of this post.

Hope this helps for anyone interested in more details.

Steve

10. ## The Following User Says Thank You to STEVE333 For This Useful Post:

frant (11-08-2018)

11. ## Re: How man dark frames?

It was pointed out to me by Mark (sharkmelley on the PI forum) that Dithering (or even slight frame-to-frame drift if no guiding is used) will have the effect of randomizing the position of the Master Dark Frame across the image thus randomizing the Dark Frame Noise. This significantly reduces the effect of the Master Dark Frame noise on the final stacked SNR. The result of including this correction is shown in the graph below.

The benefits of using Dithering is seen in the graph below which has all the same conditions except for NO DITHERING.

Thus has been an interesting and educational project. Thanks to everyone who contributed.

Steve King

12. ## The Following User Says Thank You to STEVE333 For This Useful Post:

KathyNS (11-09-2018)

13. ## Re: How man dark frames?

Steve,

This is interesting information. I haven't moved into really understanding all the technical stuff so far. I have an ASI1600MC which is supposed to have low signal to noise. If I understand things correctly, I should need fewer darks to accomplish a specific SNR, correct?

Now fewer is relative to different cameras but I think my thought process is correct.

14. ## The Following User Says Thank You to kevin.mcde For This Useful Post:

STEVE333 (11-14-2018)

15. ## Re: How man dark frames?

Originally Posted by kevin.mcde
Steve,

This is interesting information. I haven't moved into really understanding all the technical stuff so far. I have an ASI1600MC which is supposed to have low signal to noise. If I understand things correctly, I should need fewer darks to accomplish a specific SNR, correct?

Now fewer is relative to different cameras but I think my thought process is correct.
Hi Kevin - I apologize for not explaining clearly what the graph is for and how to use it.

First, the graph is designed to help you decide on a proper Exposure Time for your Lights to ensure you are getting the best final stacked image.

Second, the graph is designed to help you decide how many Darks you require to ensure the noise in the Darks don't degrade your final stacked image.

Third, the above graphs are for my DSLR/WO Star 71 telescope/IDAS LPS-V4 filter and my local light pollution. This means that they can't be used for your camera/telescope setup. However, the general shape of the curves will be similar for all imaging systems, and, I do have an Excel worksheet that would allow you to create a graph that is correct for your setup/location.

With that disclaimer let me explain how to use the graph:
1) First, the graph assumes a fixed amount of time to collect data (I believe I used 3 hrs for the above graph). The reason for this is to allow a comparison between different Exposure Times. For example, if 180 sec Exposure Times were used for the Light frames there would be (3 hr) x (60 min/hr) x (60 sec/min) / (180 sec) = 60 images to stack. However, if 600 sec Exposure Times were used for the Light frames there would be only (3 hr) x (60 min/hr) x (60 sec/min) / (600 sec) = 18 images to stack.
2) The Vertical axis is Signal-to-Noise Ratio (SNR) of the stacked image. A higher SNR means a better image.
3) The Horizontal axis is the Exposure Time used to collect the Light frames.
4) First consider the dashed black line on the graph. The graph shows how the choice of Exposure Time affects the SNR (Signal-to-Noise Ratio) of the stacked images. As intuition would suggest, longer Exposure Times yield higher SNR for the stacked image. However, Exposure Times longer than about 400-500 secs provide only marginal improvement in the stacked SNR. For example, if I used 120 sec exposures the SNR would be 40. If I used 420 sec exposures the SNR would be 50. This means the 420 sec stack would have only 40/50 = 0.8 or 80% of the noise of the 120 sec stack.
5) The family of curves for 1, 2, 5, 10 Darks shows that fewer than 5 Dark Frames will degrade the SNR, so, I need to use at least 5 Dark Frames.

I hope this makes some sense. I'm so used to using Graphs that I forget that most people don't understand graphs. I'll be glad to answer any further questions if I can.

The graph is included below for reference.

Steve

16. ## Re: How man dark frames?

Hi, Steve

I just tried to send you a PM but the site says your box is full. I would like to look at the Excel file.

Kevin

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•