PixInsight Guide: IntegerResample (knowing when to bin your data)

Binning is a topic that confuses a lot of people — myself included! In this guide I hope to cover the basics, and show you how to use PixInsight to know whether you’d benefit from binning your data.

Massive disclaimer

Let me begin by making clear that I don’t fully understand binning! It’s a complex topic, and if you want to really comprehend it, then this guide isn’t for you. But, if you just want a top-level understanding, and to ultimately know whether or not you should bin your data, then hopefully this will do the trick. I can’t promise that all my info is accurate, but the method I outline does work. Any useful info I impart is thanks to the good folks over on The Stargazers Lounge, who have taught me basically everything I know. If you’re not already a member, I recommend joining. If you’d like to correct anything I get wrong in this guide, then please leave a comment at the end or contact me here.

A bit of background…

Ok, so you’ve heard about binning, but aren’t really sure what it’s all about. That’s understandable, it’s pretty confusing. Let’s give a brief overview.

Consider that there’s always a limiting factor that provides a ceiling the quality of data you collect. You may assume this is the camera sensor, but it’s actually more likely to be your sky conditions (called “seeing”). Your telescope and mount are also factors. You could have an amazing astro camera, but if your’re imaging through a tornado, your data won’t be very good, right? That’s an extreme example, so here’s a more realistic one. You have a camera sensor with lots of pixels, and they’re small too (6248 x 4176, 3.76 μm pixels in the case of my ZWO ASI2600MC Pro). But do my turbulent city centre skies actually let me capture useful data with all of those pixels? Maybe, maybe not — but we can use PixInsight to find out.

Ultimately, what we want is to match our camera sensors to real-life imaging conditions in order to have an optimal setup. This doesn’t mean buying a whole new camera sensor, because we can change its specifications by binning. I’m going to run through two examples, and then will explain a bit more background.

Example 1: The Iris Nebula, Askar FRA400 and ZWO ASI2600MC Pro

Let’s work this through using an actual example. First, we want to analyse an image to get its vital statistics. Then we can work out whether we should bin. For this example we’ll analyse an image from my archives: The Iris Nebula, taken using my Askar FRA400 telescope and ZWO ASI2600MC Pro camera.

To analyse images using PixInsight, I like to use PSF Image Creator. It’s a free plugin — details here.

Once that’s installed, load up a freshly integrated image. Don’t to any processing to it (well, you can perform an STF if you like). Then go to Script -> Render -> PSFImage. Click Evaluate and wait for it to complete. Then you should see a view a bit like this:

I’ve highlighted what we’re interested in: the two FWHM values. Calculate what’s between the two (so about 2.22 in this case). Think of this as telling us how sharp the image is. (This is a simplification, but it works for us). Lower is better. We then need to divide this number by 1.6. 2.22/1.6 = 1.39. Note this down; we need to match to the next number we’ll calculate.

Now go ahead and close the PSF Image Creator window. Then go to Script -> ImageAnalysis -> ImageSolver. If you’re using an astrocamera then all the data should be input already. Go ahead and click OK, then wait…

Once it’s complete, look in the Process Console for your image’s resolution. This is calculated based on your telescope and camera specifications. In the example above, it’s 1.934 arcsec/pixel.

Ok, so we’ve calculated that our image resolution is 1.39 and our kit is operating at 1.934 (I think this is called “working resolution”). We want these two numbers — image resolution and working resolution — to match as closely as possible. How can we change them? Well, by this point the image resolution is fixed (it’s based on sky conditions, telescope optics, and mount tracking quality, i.e. nothing we can change now). The working resolution though can be changed, via binning. But the way it works means we can only double or triple or quadruple it. If you binx2 then you double the working resolution. Binx3 triples it. So take a look at these options and see which most closely matches our image resolution of 1.39:

No binning1.934
Binx23.868
Binx35.802
Binx47.736

The answer is… drumroll… not to bin our data. The more we bin it, the further from the image resolution of 1.6 we get. So, in this example, we’re best off not binning our data. Our system is well matched as it is.

Example 2: The Cygnus Wall, Askar 130PHQ and ZWO ASI2600MC Pro

Let’s try another example, this time on a different target and with a different telescope: my Askar 130PHQ.

First we’ll run PSF image to ascertain the image resolution:

The two FWHM values are 2.62 and 3.25. Split the difference (i.e. 2.94) and divide by 1.6 to get 1.84.

Now we run ImageSolver…

This gives us 0.778. In other words, my telescope and camera are a lot better than my sky conditions and mount. Which option gets us closest to 1.84?

No binning0.778
Binx21.556
Binx32.334
Binx43.112

Well lookey here, binx2 gets us to 1.556, which is pretty close to 1.84. So, it would be optimal for us to bin this data x2. It’s easy to do, and is best done right away, while your data is still freshly stacked.

Go to PROCESS -> All Processes -> IntegerResample. Select the correct view using the dropdown menu at the top (Ult_integrated in my example). Our Resample factor is 2 (because we’re binning x2). And we’re downsampling. Then click on the blue square at the bottom.

A warning message may pop up, but it’s fine to click Yes:

And that’s it!

That didn’t seem so bad

If you just follow those steps then you’ll know whether it’s optimal to bin your data. If you’ve got a bit more attention span left in you then we can discuss it further…

Undersampled and oversampled
Ok, so what if your image and working resolutions are mismatched? How bad is it? Well not massively. If you should bin but you don’t then you’re likely oversampled. This means you’re wasting resolution and missing out on the upside to binning (see below). If you’re on the other side — for example, if you bin when it’s not necessary — then you’ll be undersampled, and missing out on some fine detail and your stars may look blocky.

The sweet spot
The unit we use for resolution is arcsecond per pixel (“/px). Under 1.0″/px is really exceptional, and the reserve of large telescopes, very high quality mounts, and outstanding imaging locations (think up a mountain). 1.5-1.8″/px is a sweet spot for many. If you’re in that region, or close to it, then all is well. If you’re using a small telescope (under 4”) then you’re more likely to be around 2″/px.

The downside to binning
A lot of people are put off binning because there’s a downside: your image’s resolution (in terms of how many pixels large it is) is reduced. Using my 2600MC Pro as an example:

Native resolution6248 x 4176
Binx23124 x 2088
Binx32082 x 1392
Binx41562 x 1044

We want lots of pixels, right? Lots of pixels means lots of detail? Well, not necessarily. Remember that our limiting factor is likely sky conditions. Taking example #2, my Askar 130PHQ and 2600MC Pro were imaging at 0.778″/px. This is way way waaaaay better than my skies can actually accommodate. If I don’t bin, I’m using 6248 x 4176 pixels, but a lot of those are just capturing the blurring effects of the atmosphere. It’s a waste. This is why is makes sense to bin — because of the upside to binning…

The upside to binning
We can trade our camera sensor’s pixels for a boost in signal to noise ratio. This is because when we bin, we’re combining pixels. Binx2 turns four pixels into one really big pixel. This in turn reduces the noise level, which effectively boosts signal to noise ratio (SNR). Cuiv the Lazy Geek made a good video explaining this. So, returning to example #2, if I’m wasting pixels on my blurry atmosphere, I may as well trade them in for a very welcome boost in SNR. This upside is really excellent, so if you calculate your two numbers and find you’re in the middle of whether it’s beneficial to bin or not, you probably should, in order to get the SNR boost.

Upsample at the end
If you’ve used PixInsight to downsample your image, your very final step in processing can be to run IntegerResample again at the end, but this time upsampling by however much you originally downsampled. This will get you your pixels back so you can have nice big images for printing or cropping.

Guiding
We want our guiding RMS to be as low as possible, but how do we know if it’s good enough? Here’s a good tip: you want your guiding RMS to be half or less than your working resolution. So, in example #1 we were operating at 1.39. 1.39/2 = 0.7″. So, if your guiding is 0.7″ or lower (and smooth, not jumping around) then well is well. If it’s higher then look to improve it by better telescope balancing, mount maintenance, or if necessary a new mount.

What about example #2? 1.556/ 2 = 0.78″. Same rule applies; I want my mount’s guiding to be 0.78″ or lower.

Just out of interest, what if I didn’t bin that data? Natively it’s 0.778, so my mount would need to be guiding 0.4″ or lower. You need a very high quality (expensive!) mount to achieve that. Just one more reason that binning makes sense in example #2; not only are my sky conditions limiting me, but the mount is too.



Make sense?

There’s a lot to take on board there! Hopefully this guide has helped you. Just to reiterate that this is at the limit of my understanding, and I’m sure I’ve got some things wrong. But the methods outlined do work for me. If you’d like to correct me on any points then please do give me a shout and if necessary I’ll update this guide.


Nothing will motivate me to create more content quite like money!





2 thoughts on “PixInsight Guide: IntegerResample (knowing when to bin your data)

Leave a Reply

Your email address will not be published. Required fields are marked *