Author Topic: Darks & Biases: More is better but how much?  (Read 8099 times)

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • http://www.obsballona.org
Darks & Biases: More is better but how much?
« on: 2013 February 15 19:25:24 »
The general rule of thumb in imaging is that more calibration frames are better.  I have always wondered how many more and how much better.

I have completed an experiment (written up here) comparing processing of a light image using 79 vs. 43 darks and 48 vs. 148 biases.  There is clear visual improvement in the bias, small improvement in the dark, and no noticeable difference in the final light frames.  Looking at the noise evaluation from Image Integration, there is significant improvement in the bias and dark frames, and a small improvement in the lights.

The bias improvement is easy to understand.  Not only did I greatly increase the number of subs, but the bias signal is small vs. read noise so I have a lot of improvement available.  The dark improves slightly, probably due to the relatively higher base signal vs. the read noise.  I do want to get another 100 darks to see if that makes a difference.  For the lights, I dither my images by several pixels between subframes.  Using all the wonderful rejection tools and a good number of subs, much of the camera-specific noise -- which is what the bias and darks represent -- is removed.  So my calibration frame improvement is only just measurable.

Assuming I am interpreting the noise evaluation statistics correctly, the bias SNR improves by 22%, the dark by 20%, and the light by 0.05%.  The full statistics are posted with the whole story.  I would like to know people's opinion on my interpretation of the statistics.

Here are the two bias samples, which show the greatest difference of all the frames.  You can really see how the bias signal is cleaner in the master with more source frames.

48 source frames in the master:


148 source frames in the master:


My conclusion:  Take lots of calibration frames and also dither!

Full write up here.

I'd be interested to see what people think or what other questions this analysis raises.

--Andy
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Darks & Biases: More is better but how much?
« Reply #1 on: 2013 February 16 03:07:29 »
The number of dark frames you need depends (among other things) on your imaging site. If you are imaging from a bright suburban site, the sky noise will overwhelm any marginal improvement from taking lots of darks. For a pristine site lots of darks are the order of the day. If you want to quantify the number, you need to make measurements of typical sky noise at your site and the noise in your dark current. If the latter is a small enough fraction of the former (5%-- up to you to decide) you have enough darks.
For a detailed analysis, see the book by Berry and Burnell: Handbook of Astronomical Image Processing.
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Darks & Biases: More is better but how much?
« Reply #2 on: 2013 February 16 03:52:51 »
Hi Andy,

The more frames the better, but the more frames you have, the more effort is required to achieve a significant improvement. To quantify this, consider the following graph (borrowed from our official reference documentation for the ImageIntegration tool):


This graph plots the function:


where N is the number of integrated images. In plain words, this graph tells you how much SNR improves by adding one more frame to a stack. The function decreases asymptotically toward zero, showing nicely the fact that no matter how many frames you take, there will always be some noise :)

Taking into account that bias frames are very cheap, I would say that 200 is a reasonable number. A nice complement to this is Vicent's and Carlos' SuperBias method, which allows you to emulate numerically a high-quality master bias with relatively few frames, under certain conditions.

A good master bias is necessary to scale darks with our dark frame optimization algorithm. Even if your darks are very accurate (so you get dark scaling factors close to one), a high-quality master bias is necessary to achieve an accurate flat fielding.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • http://www.obsballona.org
Re: Darks & Biases: More is better but how much?
« Reply #3 on: 2013 February 16 09:56:59 »
Geoff,

Since some of the dark signal is bright (my maximum dark pixel is 0.8 or about 56,000 in 16-bit) an accurate dark would be better regardless of the sky noise.  But since a great portion has a low signal the marginal benefit would be reduced in a light polluted location.  I have Bortle scale 4 skies so everything helps.

I think that dithering and having a good number of light frames makes the most difference in eliminating CCD-based noise, regardless of the sky background.

--Andy
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • http://www.obsballona.org
Re: Darks & Biases: More is better but how much?
« Reply #4 on: 2013 February 16 10:02:50 »
Juan,

Hmm, read the documentation, that's a novel idea  :D

Looking at the chart, at 43 frames the dark is well down on curve so the small difference to 79 is understandable.

I appreciate the expert opinion providing a rule of thumb of 100 dark frames and 200 bias frames.

It is still interesting that even with measurable differences in the calibration frames, very little difference turned up in the final light image.  I attribute this to dithering, lots of exposures, and good rejection algorithms.  At AIC last year, John Smith, author of CCDAutoPilot suggested that effective dithering could remove the need for darks altogether.  I'm not ready to go there, but there is evidence in that direction.

Thanks,

--Andy
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser

Offline Jan

  • PixInsight Enthusiast
  • **
  • Posts: 82
    • Astrofotky.cz
Re: Darks & Biases: More is better but how much?
« Reply #5 on: 2013 February 17 09:41:36 »
Guys I do not see any connection between the dithering and dark frames (the above idea that good dithering can eliminate the need of the dark frames calibration).

Dithering and darks each serve to the completelly different purpose, donĀ“t they? Especially with DSLR shooting, dithering makes the noise patterns in the image very even (no artifacts after stack+stretch), darks are supposed to subtract the dark currents caused by electronics. I have also some experience with CCDs, and there I would say you can live without dithering, but not without dark/bias/flat calibration.

(for example what is the result with DSLR WTHOUT dithering can be seen here, with one of my test images taken with dslr and Ha filter= highly stretched: http://www.astrofotky.cz/~Oko1/1315130790.png)

Can you explain how dithering can reduce the need od calibration by darks?
Also it is obvious from the above graph, that increasing number of the calibration files above 60 does not make too much sense in terms of extra SNR.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Darks & Biases: More is better but how much?
« Reply #6 on: 2013 February 17 10:30:12 »
i think if you are considering hot/warm pixels only then dithering will let you reject those during integration. but there's more to dark current than just hot/warm pixels.

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
Re: Darks & Biases: More is better but how much?
« Reply #7 on: 2013 February 17 11:06:39 »
Guys I do not see any connection between the dithering and dark frames (the above idea that good dithering can eliminate the need of the dark frames calibration).
Can you explain how dithering can reduce the need od calibration by darks?
Also it is obvious from the above graph, that increasing number of the calibration files above 60 does not make too much sense in terms of extra SNR.

I agree with this. Dithering will prevent the same 'bad pixels' -- hot, cold, columns, regions -- from ending up on the same pixels every time. However, even with perfect dithering that prevents accumulated bad pixels and rejection algorithms that catch them all as outliers and reject them, you are still left with a dark noise background level in every frame, right? And that is what can be subtracted during calibration. Biases handle the baseline noise and darks handle the thermal noise generated by longer exposures, right?

That is my understanding, but I want to hear more from the other perspective.

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • http://www.obsballona.org
Re: Darks & Biases: More is better but how much?
« Reply #8 on: 2013 February 17 17:08:49 »
Dithering eliminates any signal that is constant with the position in the chip.  Dark noise is such a signal.

Darks capture the pattern of signal that a CCD produces over a set period of time at a given temperature.  That pattern is relatively stable on the chip -- hot, cold, medium -- in any case a stable pattern produced by the chip.  That means that any exposure is going to have a version of that pattern in the image.  We take lots of darks to get the best estimate of that noise.

Dark noise in an image is stable relative to the chip.  Therefore dithering and rejection will reduce that noise.  John Smith's

I'll try an experiment and combine my NGC 925 images with no calibration.  I'll post the result.
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Darks & Biases: More is better but how much?
« Reply #9 on: 2013 February 17 17:32:07 »
Dithering eliminates any signal that is constant with the position in the chip.  Dark noise is such a signal.
This is after stacking where star alignment causes a signal that is constant with position on the chip to occupy different positions on the stacked image and so pixel rejection methods will get rid of it.

Dark noise in an image is stable relative to the chip.  Therefore dithering and rejection will reduce that noise.  John Smith's
When you stack dark frames, there is no movement of any signal that is constant with the position in the chip.  They all end up in the same place in the stack.  Dithering has no effect.

Let's also get the terminology correct.  Dark current is not noise.  It is unwanted signal that is recording behaviour of your chip due to thermal electrons and this is not stuff you want in your final frame which is why we subtract the dark current from the light frame.  Noise is random, dark current is not random. It is repeatable subject to the noise limitations that apply to any signal.  Like all signals, the dark current will have some noise in it.  This is the slight, random variation from one dark frame to the next.  It is this random variation (AKA noise) that we try to eliminate by averaging lots of dark frames. When you calibrate your lights this noise (or uncertainty) in the dark current (not the dark current itself) is what you have to worry about as it will add to the noise in your light in the usual square root way.
Good article here http://www.qsimaging.com/blog/?p=52
Geoff
« Last Edit: 2013 February 17 17:43:44 by Geoff »
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • http://www.obsballona.org
Re: Darks & Biases: More is better but how much?
« Reply #10 on: 2013 February 17 21:02:24 »
Dithering eliminates any signal that is constant with the position in the chip.  Dark noise is such a signal.
This is after stacking where star alignment causes a signal that is constant with position on the chip to occupy different positions on the stacked image and so pixel rejection methods will get rid of it.

Exactly.

Quote
Dark noise in an image is stable relative to the chip.  Therefore dithering and rejection will reduce that noise.  John Smith's
When you stack dark frames, there is no movement of any signal that is constant with the position in the chip.  They all end up in the same place in the stack.  Dithering has no effect.

Let's also get the terminology correct.  Dark current is not noise.  It is unwanted signal that is recording behavior of your chip due to thermal electrons and this is not stuff you want in your final frame which is why we subtract the dark current from the light frame.  Noise is random, dark current is not random. It is repeatable subject to the noise limitations that apply to any signal.  Like all signals, the dark current will have some noise in it.  This is the slight, random variation from one dark frame to the next.  It is this random variation (AKA noise) that we try to eliminate by averaging lots of dark frames. When you calibrate your lights this noise (or uncertainty) in the dark current (not the dark current itself) is what you have to worry about as it will add to the noise in your light in the usual square root way.
Good article here http://www.qsimaging.com/blog/?p=52
Geoff

Absolutely spot on.  So the same reasons we dither are the reasons we take darks.  We want to eliminate the unwanted signal (great terminology) from the final image, and both methods reach that end.

Yes, dark signal is subject to the same noise as everything else, so more frames reduce that noise.

Now here is a bit of data.  This is 36 dithered frames aligned and integrated in PixInsight.  I cannot see any significant dark noise in this image (there are things that require flat fielding, but not the spotty pattern of dark signal).

I think I will be thinking on this a while.  Clearly high quality calibration frames are important, but they are less important when you have many exposures that are dithered.  For me, that is more important for color which I bin 2x2 and take many fewer frames.

One other thing to mention.  John Smith mentioned a careful, non-random algorithm for dithering.  This would ensure that the chance of several frames being in exactly the same position is small.  I think this is important because current plate solve technology places an object on almost exactly the same pixels.  Simple deterministic dithering repeats, random dithering creates the risk of multiple frames being in the same spot (hey, it can happen, it is random, not evenly distributed).

Clear skies (except when we need rain, like this winter in SoCal)

--Andy
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser

astropixel

  • Guest
Re: Darks & Biases: More is better but how much?
« Reply #11 on: 2013 February 18 03:28:07 »
Dithering! Hmmm... another convert. Dithered stacks are smoother. Would it be accurate to say, that calibrated stacks, dithered or not, respond better to colour calibration and post processing than stacks that have not been calibrated - or is that just my imagination?

Offline andyschlei

  • PixInsight Addict
  • ***
  • Posts: 157
    • http://www.obsballona.org
Re: Darks & Biases: More is better but how much?
« Reply #12 on: 2013 February 19 20:30:01 »
 :police: astropixel, I don't have any idea on that question.  How would you suggest testing it?

BTW, I've added another 100 biases to the collection and the difference in the image is notable.  More on this next month when I'll have time to write it up.

--Andy
Observatorio de la Ballona
CDK 12.5, NP-101, C-11
AP-1200, AP-900
ST-10 XME, CFW-8, Astrodon v2 filters
Pyxis Rotator, TCF Focuser

astropixel

  • Guest
Re: Darks & Biases: More is better but how much?
« Reply #13 on: 2013 February 20 01:05:11 »
Just my observation. Testing? I don't know. No time for that.

I use a box spiral pattern for dithering, by sequencing RA and DEC in a predetermined sequence, with the hand controller buttons. 10 - 15 pixels. I think it works very well for an unguided system, particularly DSLR. The target image remains within the frame and images are never in the same position. Easy enough to work out. But I don't think that dithering should replace proper calibration. I use manual dithering with my CCD as well.