Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

1st m31 attempt. How much difference will dark frames make?


Recommended Posts

Yes I have wondered about the value of dark frames and I have enjoyed reading this discussion.

Without going through the analysis (*** foot note) of the dark frames I thought up a simple  experiment that  anyone can do.

This experiment will tell you how good this dark frame subtraction is working. It is all about statistics. The tool we will press into service is the histogram. The figure we will be computing  is :  Noise Power. This is very easy to compute.

Explanation:

For all those versed in basic electrical theory:

Power = v^2 / R  ...  where v is the RMS voltage and R is resistance.  Now RMS stands for  Square_Root( Mean ( Voltage ^2)) .

In statistics  one determines the "Standard Deviation" (SD)  now, quite simply Standard is defined as the  RMS deviation or 

SD is  the Square_Root (mean (deviation from the mean)^2) . Mean is the same as average. Notice the similarity between vRMS and SD . They are one and the same!  Now we invoke a number called Variance which is SD^2. Variance is the same as power and SD is the same as voltage.

So  we have tied statistics to electronics. To compute the noise power in the dark frame we merely compute the histogram compute the SD, assume the 50% width represents the SD, and square this number for a measure of the noise power... simple!

The Experiment:

1. Create a dark frame, by what ever method ... averaging, clipped etc. , for a given exposure. Call this image Idark

2.  With the camera lens fully covered take a " light frame".  Call this frame Ilight

This represents the noise that would have been added to the image if we has  opened the aperture.

Now Display a histogram for Ilight and measure the 50% width and square this number. (Pl)

Next subtract the the dark frame (Idark) from the "light frame" (ilight).  Call this deltaLight. This is what one would do normally in the course of the work flow.

Display the new histogram. The relative widths will show any improvement in noise reduction. Ideally delta Light will have zero width.

You can see, using this method, how effective is a previously generated master dark  on the imaging night.

Jeremy

*** I run Photoshop CS3 (extended) that has a link to my mathematics program (MATLAB). I import  images from CS3 into MATLAB then operate on the image and pass it back to Photoshop  for viewing etc.

Link to comment
Share on other sites

  • Replies 36
  • Created
  • Last Reply

Addition to the previous post and for completeness:

We estimated the noise power of the light frame ... Pl

We then "cancelled" the noise in this light frame using the master dark frame and estimated the noise power (Pdelta_light) from the 50% width of the histogram.

We now take a ratio of these powers (Pi / Pdelta_light) and calculate this gain  /figure of merit (Gdb)

Gdb = 10*Log (Pi / Pdelta_light)

If Gdb is positive we are actually increasing the SNR in our light frame.

If Gdb is negative then it is best not to use the current master dark and create a new one.

Plotting Gdb temperatures will show an interesting graph!!

Jeremy

Link to comment
Share on other sites

Addition to the previous post and for completeness:

We estimated the noise power of the light frame ... Pl

We then "cancelled" the noise in this light frame using the master dark frame and estimated the noise power (Pdelta_light) from the 50% width of the histogram.

We now take a ratio of these powers (Pi / Pdelta_light) and calculate this gain /figure of merit (Gdb)

Gdb = 10*Log (Pi / Pdelta_light)

If Gdb is positive we are actually increasing the SNR in our light frame.

If Gdb is negative then it is best not to use the current master dark and create a new one.

Plotting Gdb temperatures will show an interesting graph!!

Jeremy

I won't lie, I think I lost you along the way there.

I think I understand the histogram bit.

If I take a master dark and compare the histogram to a single light, then the dark is taking out about 50% of the difference between the two?

Link to comment
Share on other sites

Greetings Chris,

Sometimes its a bit tough explaining stuff on a forum because my description might not be adequate  nor complete.  Imagine that you are taking an image and processing this image using a master dark frame.

This is what one does:

1. Create your master dark frame as per usual procedure. Let us assume it is for a 600s exposure.

2. Imagine you are taking an image (light frame) but cover the camera so that no light reaches the CCD.  Acquire a CCD image with the lens cover on. What we are left with, after this exposure,  is the CCD systematic noise and random noise associated with this exposure (600s). It is this noise that is added to the extra signal due to the image we want to obtain.

3.   We now apply the master dark frame to this "light" frame obtained in part 2 above.  When we do this we are left with  a less noisy frame (hopefully).

So here are our two files:

File#1 obtained from the exposure in part #2 above.

and

File #2 obtained from master dark frame subtraction from File#1 (part #3 above)

The issue now is to find the noise powers associated with File#1 and File#2

Finding the noise power is very simple if we could measure the voltages with a true RMS volt-meter or compute these powers from the file values but this is easier said than done. What we have available is a histogram the shape of which approximates a Gaussian PDF. So my quick method of finding the RMS voltage associated with the files is to assume that the width of the histogram at the 50% level is 1 standard deviation so by measuring this width one gets a measure  of the noise voltage. Taking the square of this value is a measure of the noise power.  A point to be noted is that the peak levels of the histograms may be different so these levels may have to be normalised.

If

the 50% width of histogram #1 taken from File#1 is v1

and

the 50% width of histogram #2 taken from File#2 is v2

We calculate powers

P1 = v1**2

and

P2 = v2**2

The ratio of these power levels is converted, as per standard practise, to decibels ie Gdb = v10*log(P1 / P2) where the gain in db is Gdb.

This is a good figure of merit  where positive numbers are good.

Please tell me how you go.

I hope I have explained it to your satisfaction,

Jeremy.

Link to comment
Share on other sites

Greetings Chris,

Sometimes its a bit tough explaining stuff on a forum because my description might not be adequate nor complete. Imagine that you are taking an image and processing this image using a master dark frame.

This is what one does:

1. Create your master dark frame as per usual procedure. Let us assume it is for a 600s exposure.

2. Imagine you are taking an image (light frame) but cover the camera so that no light reaches the CCD. Acquire a CCD image with the lens cover on. What we are left with, after this exposure, is the CCD systematic noise and random noise associated with this exposure (600s). It is this noise that is added to the extra signal due to the image we want to obtain.

3. We now apply the master dark frame to this "light" frame obtained in part 2 above. When we do this we are left with a less noisy frame (hopefully).

So here are our two files:

File#1 obtained from the exposure in part #2 above.

and

File #2 obtained from master dark frame subtraction from File#1 (part #3 above)

The issue now is to find the noise powers associated with File#1 and File#2

Finding the noise power is very simple if we could measure the voltages with a true RMS volt-meter or compute these powers from the file values but this is easier said than done. What we have available is a histogram the shape of which approximates a Gaussian PDF. So my quick method of finding the RMS voltage associated with the files is to assume that the width of the histogram at the 50% level is 1 standard deviation so by measuring this width one gets a measure of the noise voltage. Taking the square of this value is a measure of the noise power. A point to be noted is that the peak levels of the histograms may be different so these levels may have to be normalised.

If

the 50% width of histogram #1 taken from File#1 is v1

and

the 50% width of histogram #2 taken from File#2 is v2

We calculate powers

P1 = v1**2

and

P2 = v2**2

The ratio of these power levels is converted, as per standard practise, to decibels ie Gdb = v10*log(P1 / P2) where the gain in db is Gdb.

This is a good figure of merit where positive numbers are good.

Please tell me how you go.

I hope I have explained it to your satisfaction,

Jeremy.

Yes that is much easier to digest. Thank you for taking the time to explain.

Thus using this method one can measure the real value of dark substraction using a master dark ie 20 darks in a master vs 80

Also one could create a curve to see where across a range of temps for a given exposure darks become valuable or visa versa at a given temp at what exposure length do darks become valuable.

These would be sensor specific.

Might take this on as a project for my 600D when I have a bit of time.

Thanks again

Link to comment
Share on other sites

Yes that is much easier to digest. Thank you for taking the time to explain.

Thus using this method one can measure the real value of dark substraction using a master dark ie 20 darks in a master vs 80

Also one could create a curve to see where across a range of temps for a given exposure darks become valuable or visa versa at a given temp at what exposure length do darks become valuable.

These would be sensor specific.

Might take this on as a project for my 600D when I have a bit of time.

Thanks again

...

Thus using this method one can measure the real value of dark substraction using a master dark ie 20 darks in a master vs 80

Also one could create a curve to see where across a range of temps for a given exposure darks become valuable or visa versa at a given temp at what exposure length do darks become valuable.

These would be sensor specific.

Might take this on as a project for my 600D when I have a bit of time.

Thanks again'

Now that we have quantified the "value" of dark frame subtraction or obtained a figure of merit " with a good scientific pedigree " i.e. we  have faith in the analysis then as you put it one can test various exposures and numbers of exposures. A very interesting experiment to do would be to test out a single master dark on lights of various temperatures.

Jeremy.

Link to comment
Share on other sites

Greetings Chris D. ,

I have started doing an experiment to quantify the value or otherwise of using dark frames. This experiment is going to be a slow process.

I started by using a Star Shoot Pro V2, cooled camera  and began the experiment by taking 30 x 300 sec. cooled dark frames. These darks were combined in DeepSky Stacker to produce the first master dark  :

Master_Dk_30fr_300s.tif

I then took a cooled light frame and an un-cooled light frame:

light_300_cool_0002.tif

light_300_no_cool_0010.tif

Each of the above " light" frames had their noise mitigated by the master dark frame above to give us 2 files:

image_md30_cool.tif

image_md30_no_cool.tif

For each of the above files I obtained the statistics mu (mean) and sigma(standard deviation). Note the sigma is the analogue of Vrms.

Table #1:

                                             mu       Sigma
 
Master_Dk_30fr_300s    :      1.32       3.24

light_300_cool_0002      :     35.51    11.89
 image_md30_cool         :     20.03      3.28
 
light_300_no_cool_0010 :     17.16    17.24
image_md30_no_cool     :     21.11     7.23

It is interesting to point out the very low noise associated with the master dark due to the integration.

Converting the sigma's (Vrms) to power ratios in db we get:

1.  For the cooled image with the cooled dark frame substraction the noise is reduced by:

Gdb = 20log(11.89/3.28)  =  11.2db

This is an almost 10:1 reduction in noise power... sounds too good to be true!

2. Applying the cooled master dark to the un-cooled light frame we get:

Gdb = 20log(17.24 / 7.23) =- 7.5db

This is quite a good result  but the noise power is twice that where the temperatures are matched . We still have a "fair" noise reduction (-7.5 db)

and this is a good result.

and

The difference between the cooled and un-cooled frame is:

Pdb = 20log(17.24/ 11.89) = 3.2 db

Quite a good result as the noise power due to cooling is halved.

Getting enough results to show trends is going to be a very slow process.

Jeremy

Link to comment
Share on other sites

Greetings Chris D. ,

I have started doing an experiment to quantify the value or otherwise of using dark frames. This experiment is going to be a slow process.

I started by using a Star Shoot Pro V2, cooled camera and began the experiment by taking 30 x 300 sec. cooled dark frames. These darks were combined in DeepSky Stacker to produce the first master dark :

Master_Dk_30fr_300s.tif

I then took a cooled light frame and an un-cooled light frame:

light_300_cool_0002.tif

light_300_no_cool_0010.tif

Each of the above " light" frames had their noise mitigated by the master dark frame above to give us 2 files:

image_md30_cool.tif

image_md30_no_cool.tif

For each of the above files I obtained the statistics mu (mean) and sigma(standard deviation). Note the sigma is the analogue of Vrms.

Table #1:

mu Sigma

Master_Dk_30fr_300s : 1.32 3.24

light_300_cool_0002 : 35.51 11.89

image_md30_cool : 20.03 3.28

light_300_no_cool_0010 : 17.16 17.24

image_md30_no_cool : 21.11 7.23

It is interesting to point out the very low noise associated with the master dark due to the integration.

Converting the sigma's (Vrms) to power ratios in db we get:

1. For the cooled image with the cooled dark frame substraction the noise is reduced by:

Gdb = 20log(11.89/3.28) = 11.2db

This is an almost 10:1 reduction in noise power... sounds too good to be true!

2. Applying the cooled master dark to the un-cooled light frame we get:

Gdb = 20log(17.24 / 7.23) =- 7.5db

This is quite a good result but the noise power is twice that where the temperatures are matched . We still have a "fair" noise reduction (-7.5 db)

and this is a good result.

and

The difference between the cooled and un-cooled frame is:

Pdb = 20log(17.24/ 11.89) = 3.2 db

Quite a good result as the noise power due to cooling is halved.

Getting enough results to show trends is going to be a very slow process.

Jeremy

Brilliant.

So temperature matching is a must.

Interesting to see that DSS stretching of unmatched temperature is still effective but not as good as matched.

So order of magnitude in noise reduction,

For short exposure of 300s

1) Matched temp darks.

2) using darks even if unmatched.

3) cooling camera.

Would be interesting to see if this holds true on 15min sub.

Link to comment
Share on other sites

Re:

Very interesting! But shouldn't the dark be made at the same temperature? Imho you would need a cooled dark and an uncooled dark ... but anyway, very intersting!

Yes UHB . Good observation. But one has to see what the result will be.

I did this to see what will be the result of a mis-match.

Ultimately I would like to know the " shelf life " of the master dark.

The cooling regulation on this StarShoot camera is not the best so I would

get a rough idea of what to expect.

Gee Whiz Chris. 15min subs ? I'll try out this. But this will be really slow, seeing I take about 30 Darks.

This looks as if this will be an over night job.

The current experiment will go like this (on 5 min. subs)

I create master darks using 1, 2, 4, 8 ... to 30 subs (6 in all) cooled and uncooled

Then mitigate the noise in the "light " frame and draw a graph. I imagine that using 15min

subs will produce a similar result partly because of the base time integration.

ie, both the light and darks have the same times.

But we " shall see what we see"

Jeremy.

Link to comment
Share on other sites

Re:

Very interesting! But shouldn't the dark be made at the same temperature? Imho you would need a cooled dark and an uncooled dark ... but anyway, very intersting!

Yes UHB . Good observation. But one has to see what the result will be.

I did this to see what will be the result of a mis-match.

Ultimately I would like to know the " shelf life " of the master dark.

The cooling regulation on this StarShoot camera is not the best so I would

get a rough idea of what to expect.

Gee Whiz Chris. 15min subs ? I'll try out this. But this will be really slow, seeing I take about 30 Darks.

This looks as if this will be an over night job.

The current experiment will go like this (on 5 min. subs)

I create master darks using 1, 2, 4, 8 ... to 30 subs (6 in all) cooled and uncooled

Then mitigate the noise in the "light " frame and draw a graph. I imagine that using 15min

subs will produce a similar result partly because of the base time integration.

ie, both the light and darks have the same times.

But we " shall see what we see"

Jeremy.

Hi Jeremy,

Good work, and did not mean to challenge you to a 15min test, but rather to thinking out loud.

Noise increases with time, but not sure if linear. So non cooled camera on a long sub like 15min is overwhelmed by noise.

300sec may still be in the sweet spot of your sensor.

The darks should have a pretty long shelve life again depending on the quality of the sensor. It should not change much over its life other than hot pixels.

Can I suggest something like this on you darks. 5min Take 64 darks. Then stack them in multiples of 8. (Could do multiples of 7) this will allow you to see the diminishing returns of reduction. I.e the point where each new darks does not add more noise reduction.

Theory is at 8x8 sub's will reduce the noise to 8th of original noise.

For the 15min sub only do 8, to establish baseline then project at same ratio.

Anyway just a thought.

Link to comment
Share on other sites

Hi Chris,

About the 300s subs.  I just pulled a number out of the hat. No logic. It just sounded alright at the time !!

About your suggestion about taking 64 x 5m  darks etc.  Suggestion taken. I'll start taking the dark frames this evening.

Also I will take a relatively large number of 15m (900 s) darks and keep these , also, as part of my calibration data.  At 4 subs per hour taking 40 subs will take 10h so this definitely an over night job. I also think that if I do not walk around looking at the PC every now and then the job will be completed faster!!

Jeremy

I'll make up the experiment plan and enter it here before I start processing the data.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.