Author Topic: Binned vs unbinned color  (Read 6860 times)

Offline astrodoc71

  • PixInsight Enthusiast
  • **
  • Posts: 93
Binned vs unbinned color
« on: 2012 August 03 02:40:06 »
New to group here and just curious what everyone's experience is with this. I have not been happy with binned color using other processing tools, but with a long focus set-up and marginal weather unbinned is a major hassle obviously as it takes forever to acquire enough color. Hopefully things are different using PI?

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Binned vs unbinned color
« Reply #1 on: 2012 August 03 05:19:59 »
I don't see the point in binning. Whether you bin or not, the same number of photons (ie information) fall on your sensor and without binning you get better resolution. Yes, you get less read noise by binning, but as long as your exposures are sensible enough to get well above the read noise (as they should be in any case) this should be of little consequence. I don't bin any more and I don't find it to be a problem in terms of exposure length.
Bear in mind that binning 2 x2 has much the same effect as halving your focal ratio and then google "focal ratio myth" to see that there are no black and white answers here.
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Binned vs unbinned color
« Reply #2 on: 2012 August 03 09:20:00 »
I find it helpful to keep this relationship in mind: t scales with r^2/s, where t is sky limited subexposure time, r is read noise and s is sky flux.

Suppose it takes 10 minutes to be sky limited with an L filter. An RGB filter has roughly one third the bandwidth of an L filter, so sky flux goes down by a factor of three. So it takes 30 minutes to be sky limited with an RGB filter. Most people don't go three times longer with RGB. So their RGB subs binned 1x1 are not sky limited.

Now suppose you bin your RGB 2x2. Sky flux is now four times larger, and so you need 7.5 minutes to be sky limited with binned RGB. However, sometimes read noise when binning is a bit larger, so 7.5 minutes is not quite enough in these cases. Bump up back to 10 minutes and you can account for that, at least roughly.

So as a rule of thumb if you bin 2x2 your RGB at the same exposure time as L your RGB subs will be sky limited to the extent that your L is. If you don't bin you really should be going three times longer with your RGB.

Regards,
Mike

Offline astrodoc71

  • PixInsight Enthusiast
  • **
  • Posts: 93
Re: Binned vs unbinned color
« Reply #3 on: 2012 August 03 18:11:20 »
So if your unbinned L is for example 2 hours, then unbinned RGB is roughly 6 hours total or 6 hours per filter (i.e 18 hours total- seems like a lot)? Thanks guys for your time on this. I realize it's getting away from processing per se
Regards,
Dave

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Binned vs unbinned color
« Reply #4 on: 2012 August 03 19:40:06 »
6 per filter, not practical, so either bin or accept the additional noise. Someone else needs to pipe up on your question. The only thing that I know of that may be an issue is with StarAlignment's registration mode when you register the binned to the unbinned. The Auto default may give ringing around stars, if so try Bicubic Spline instead.

Mike

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Binned vs unbinned color
« Reply #5 on: 2012 August 03 22:21:36 »
6 per filter, not practical, so either bin or accept the additional noise. Someone else needs to pipe up on your question.
Mike
Good thread here http://pixinsight.com/forum/index.php?topic=674.msg4715;topicseen#msg4715 including a response by the PixInsight Jedi Grand Master himself.
See also here http://pixinsight.com/forum/index.php?topic=2355.msg16254;topicseen#msg16254
Geoff
« Last Edit: 2012 August 03 22:33:50 by Geoff »
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline RBA

  • PixInsight Guru
  • ****
  • Posts: 511
    • DeepSkyColors
Re: Binned vs unbinned color
« Reply #6 on: 2012 August 04 04:09:08 »
The Auto default may give ringing around stars, if so try Bicubic Spline instead.

Although this takes the discussion to a different topic... I've been talking to Juan about this offline.

Considering the ringing issue wasn't the case before Lanczos was added to PixInsight, but it is now that Lanczos is the "Auto" algorithm of choice, I must say that, IMHO, this is not acceptable. The "auto" interpolation method shouldn't produce ringing (undershoot) effects under common star alignment situations. I guess all I'm saying is that the "Auto" mode should be smarter than what it is now. AFAIK, now it's just using Lanczos regardless, but then, why create an "Auto" mode, just set the default to Lanczos instead.

My suggestion would be that the "Auto" mode is selected, and the application suspects that ringing/undershoot will happen, it should automatically switch "behind the scenes" to Bicubic Spline or whatever it was using before.... Makes sense?


Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Binned vs unbinned color
« Reply #7 on: 2012 August 05 10:23:36 »
Rogelio, I like your idea.

Geoff, those threads seem to make the case that there is no benefit to binning once your subs are sky limited. I think there is. What I have here is a project that I think shows that binning does have a benefit. You can download it from Endor Forum Shared Files mschuster/Binning.zip.

Earlier this year I was trying to collimate a Cassegrain and took four 300 second subs of M53, two binned 1x1 and two binned 2x2. Looking at the subs, the 2x2 does not look any better than the 1x1 in terms of SNR, at least subjectively. But is there an objective way to tell?

The median ADU of the 2x2 subs is about four times larger than the median of the 1x1 subs. Drag the icon Bin1x1Calibration onto one of the 1x1 subs and note that the result's median is 408 ADU. Drag the icon Bin2x2Calibration onto one of the 2x2 subs and note a median of 1741 ADU. These icons basically subtract the bias master from each sub and take the average.

Of course all subs have captured roughly the same number of photons, their exposure times were all the same. But the 2x2 pixels are four times larger and so have captured four times as many photons as the 1x1 pixels. As a result their ADUs are four times larger. The gain of all four subs is the same, so this factor of four is in fact signal (electrons) not just ADUs.

The noise in the 2x2 subs is about twice as large as the noise in the 1x1 subs. Drag the icon Bin1x1Difference onto one of the 1x1 subs and run the NoiseEvaluation script on the result, you will get 7.4e-4. Drag the icon Bin2x2Difference onto one of the 2x2 subs and run the script, you will get 1.4e-3.

These icons just subtract the two subs from one another and add 0.5 to avoid clipping. Subtracting removes the bias, dark current, fixed pattern and also the signal. What is left is roughly noise (read noise, dark current shot noise, signal shot noise) and the script measures this. You can also look at the histogram of the difference, zoom in around 0.5. You will see the histogram is roughly a Gaussian profile, the bin 2x2 profile is wider than the bin 1x1 profile.

I think photon statistics accounts for the factor of two increase in noise. Noise goes up with the square root of the signal. Four times the signal in each pixel, twice the noise in each pixel.

So signal is four times larger in the 2x2 and noise is two times larger in the 2x2. Hence signal to noise is twice as large in the 2x2. Binning does improve SNR.

As I mentioned, subjectively there does not seem to be much difference between the subs. Maybe the reason for this is that the image here is basically high signal to noise ratio stars (high SNR due to their brightness) and so the improved SNR is not visible. But suppose there was a faint spiral arm or tidal tail you wanted to capture. The improved SNR of binning might help you do so. In this project the median pixel is a sky background pixel, and its SNR is twice as big when binned. Add a weak signal to this background and the improved SNR of binning will help resolve it.

If I have made a mistake here please let me know.

Regards,
Mike

Update: Hopefully the math below is correct.

Gain in all subs is 0.45 e-/ADU. Median 1x1 signal is 408 * 0.45 = 184 e-, median 2x2 signal is 1741 * 0.45 = 783 e-. Bin 1x1 noise is 7.4e-4 * 65535 * 0.45 / sqrt(2) = 15 e- rms, bin 2x2 noise is 1.4e-3 * 65535 * 0.45 / sqrt(2) = 29 e- rms. The 65535 factor here converts normalized units to ADUs. The sqrt(2) factor accounts for the quadrature addition of the sub's noise in the difference, assuming equal noise in the two subs.

So bin 1x1 median SNR is 184 / 15 = 12 and bin 2x2 median SNR is 783 / 29 = 27. Median SNR gain by binning is 27 / 12 or about 2.

Note, as a double check, taking the square root of the signal gives for bin 1x1 sqrt(184) = 14 e- rms and for bin 2x2 sqrt(783) = 28 e- rms. These are noise estimates simply based on photon statistics. They match the noise estimate above closely.
« Last Edit: 2012 August 05 16:19:14 by mschuster »

Offline Ignacio

  • PixInsight Old Hand
  • ****
  • Posts: 375
    • PampaSkies
Re: Binned vs unbinned color
« Reply #8 on: 2012 August 05 15:00:31 »
Interesting discussion. My question is if there is a noticeable difference between binning during acquisition or thru software, during processing. Maybe there is something about read noise electronics that makes a difference, but if not, it would be more interesting to acquire unbinned and then decide if you need more SNR or more resolution.

best
Ignacio

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Binned vs unbinned color
« Reply #9 on: 2012 August 05 18:05:32 »
Ignacio, I don't know. But if the subs are sky limited maybe software binning will be similar. The software result might be a bit nosier I think (since there were four pixel reads rather than one), but the increase in noise should be negligible if sky limited. This is what I have read.

If you software bin your raw subs, what do you use for calibration masters? Do you software bin the 1x1 masters too first and then calibrate? On the other hand, maybe it is best to calibrate first with bin 1x1 masters and then software bin the calibrated result. Or maybe you create binned 2x2 masters on the camera and use those on the software binned raw subs?

If you use Resample to software bin I think you will get an interpolated result that is not quite the same as a hardware bin. The result may be less noisy due to the smoothing done by the interpolation. So this is another variable in the comparison. Juan posted a PixelMath expression here that does a 'pure' 2x2 binning by summing pixels.

As a quick test I tried this in my project: calibrated first the raw 1x1 subs using the 1x1 masters, then binned using Juan's method and then measured the results. Median is 1631, noise is 1.5e-3. So the result measures basically the same as the hardware binning.

Regards,
Mike

Offline Geoff

  • PixInsight Padawan
  • ****
  • Posts: 908
Re: Binned vs unbinned color
« Reply #10 on: 2012 August 05 21:10:54 »
If I have made a mistake here please let me know.
Hi Mike
I downloaded the files and checked them.  I agree with the figures you have quoted and there is nothing wrong with your reasoning.  However, I am still left wondering.  It very much looks like there is a free lunch involved here, and as we all know there is no such thing.
If we agree that binning 2 x 2 improves SNR the surely the same argument applies to binning 3 x 3 or 4 x 4. If we do this we can save even more time with our colour shots, so why not bin 3 x 3 or 4 x 4?
In fact, carrying this argument to absurdity, why not just bin the whole chip and get a wonderful SNR.  Obviously SNR is not the only issue involved here. The loss of resolution through binning must come into play at some stage and there will come a time when further binning starts to degrade the image.  The question is when. I think that the following quote from Juan is of relevance here:
If the image includes small structures with high chrominance contents, spatial resolution can be nearly as important for the chrominance as it is for the luminance. For example, consider a prime focus image of a galaxy, M101 for example. There are many HII regions that are both very small and very strong in the chrominance. If you don't provide enough spatial resolution for the RGB components, these structures will tend to be desaturated, at least partially.
I think this topic needs a bit of quantitative investigation.  It may well turn out that imaging globular clusters, say,  is best done with 1 x 1 binning, while faint outer halos of planetary nebs are best done with 3 x 3 or 4 x 4.  Who knows?
Geoff
Don't panic! (Douglas Adams)
Astrobin page at http://www.astrobin.com/users/Geoff/
Webpage (under construction) http://geoffsastro.smugmug.com/

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: Binned vs unbinned color
« Reply #11 on: 2012 August 06 00:00:34 »
Correct, Geoff.  You need to consider the image pixel scale binned and unbinned, relate to such things as seeing conditions as well.

In terms of exposure times, there's discussion above about sky background limited exposures, but there's also saturation points to consider at the upper end of the scale.  And my Kodak 8300 sensor (QSI583), for example, exhibits some blooming/overflow (not sure of the correct term - it's not true blooming) at binned exposures of very bright stars, but not at 1x1.  So if I have a very bright star and binning does this overflowing, I've either got to look at multiple exposures and some sort of HDR or exposure blending, or go unbinned.