Author Topic: converting binned 2x2 to binned 1x1  (Read 2661 times)

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
converting binned 2x2 to binned 1x1
« on: 2018 April 23 08:26:51 »
Hello people,

- I have image subs all binned 1x1
- I also have aux files (e.g bias, darks) binned at 2x2.

I believe this is common in the LRGB technique, for which people take L subs at 1x1 and R G and B at 2x2. I have a lot of these.

- I'm aware that star registration can be used to convert 2x2 image subs to 1x1 by choosing a 1x1 image as the reference file.

The 2x2 calibration files have no star images in them so I can't use Star Registration to convert them to 1x1 for application to the 1x1 L (image) files so how do I calibrate 1x1 images with 2x2 calibration files?  :-\ :sad: Is that what I need to do?

I'm barely keeping my nose above water and I hope I'm not missing something obvious re 1x1 L and 2x2 R, G and B and calibration files. I find it difficult to even state the problem clearly!

Help, please!

James

Offline ngc1535

  • PixInsight Old Hand
  • ****
  • Posts: 326
Re: converting binned 2x2 to binned 1x1
« Reply #1 on: 2018 April 23 08:45:23 »
Hello people,

- I have image subs all binned 1x1
- I also have aux files (e.g bias, darks) binned at 2x2.

I believe this is common in the LRGB technique, for which people take L subs at 1x1 and R G and B at 2x2. I have a lot of these.

- I'm aware that star registration can be used to convert 2x2 image subs to 1x1 by choosing a 1x1 image as the reference file.

The 2x2 calibration files have no star images in them so I can't use Star Registration to convert them to 1x1 for application to the 1x1 L (image) files so how do I calibrate 1x1 images with 2x2 calibration files?  :-\ :sad: Is that what I need to do?

I'm barely keeping my nose above water and I hope I'm not missing something obvious re 1x1 L and 2x2 R, G and B and calibration files. I find it difficult to even state the problem clearly!

Help, please!

James

Hi James,

Just a quick note. You cannot calibrate 1x1 images with 2x2 biases and darks. You CAN, if done correctly, calibrate 1x1 data with 2x2 flat field images.

So the quick answer to your question is that you need 1x1 biases and darks to calibrate your 1x1 data.

The same is true going the other direction... unfortunately you cannot take 1x1 biases and darks and use them to calibrate 2x2 data. You CAN, if done correctly, use 1x1 flats to calibrate 2x2 data. This is actually something I do quite often.


-adam

P.S. The process you were looking for is Integer Resample... but it would have gotten you into trouble- you would have made the images the correct size to calibrate..but the results would not have been desirable.

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
Re: converting binned 2x2 to binned 1x1
« Reply #2 on: 2018 April 23 12:04:21 »
Thank you very much, Adam.

I've noted what you said above, another useful bit!

I think I may have cleared up my thinking a bit from my original question.

I suppose:
I take calibration frames, bias. darks and flats, as 1x1.
My L subs are best done as 1x1. The R, G, and B may be in 2x2.
After this, I can resize the 2x2 to 1x1 using star registration with a good L image as the reference file, as a FIRST step. This will produce R G and B 1x1 files, which can then be calibrated with the 1x1 calibrated files.

This make any sense to you? It feels kind of roundabout. I may have some wrong assumptions holding me up? How else can I get along with 1x1 L files and 2x2 R, G and B files?

Thank you again.
James

Offline ngc1535

  • PixInsight Old Hand
  • ****
  • Posts: 326
Re: converting binned 2x2 to binned 1x1
« Reply #3 on: 2018 April 23 13:00:49 »
I understand your intent... but alas..no, this will result in the same issue.
You need to match the darks and biases with the appropriate data in terms of binning (and perhaps temperature).

When you take a dark frame binned 2x2, the on-chip binning combines the information of 2x2 sets of pixels (a group of 4 pixels).
This will result in a single value of say 200. Now the original unbinned values in those original 4 pixels could have been 40,60,45, and 55 (addiing up to 200). OR
they could have been 20,80,50,50... or some other combination.

If you upsample a dark frame that is binned 2x2 with a value of 200... you probably divide the light into 4 pixels of just 50,50,50,50 (it  depends on the resample method).

So you will get two different answers if you subtract with an upsampled dark compared with an original dark at the same binning.

In your example below you tried to get around it by not touching the calibration data and just upsampling the image itself. This doesn't work for the same reason. If you take a data frame binned 2x2 and then upsample it- you will again need to arbitrarily assign values to the four new pixels... these values contain the signal+dark+bias stuff. Likely you will just take that pixel and divide up the value into four. However, in the 1x1 dark frame the dark values are different in each pixel... so the subtraction will not be correct.

I suspect I am not being entirely correct in the above... the readnoise is certainly going to be different as well... since you are getting the readout of four individual pixels unbinned...but only one read hit for the binned 2x2.

Anyway...I hope this hints that you don't want to resample biases or darks (or resample data to fit a bias or dark, because that is like resampling the bias/dark and not the data..same thing)

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
Re: converting binned 2x2 to binned 1x1
« Reply #4 on: 2018 April 23 14:46:21 »
Hello ngc1535!

Your explanation was not quite clear, but it gives me a very good idea what I'm running into here.

THANKS! :P 8)

You've brought up and pretty well explained what I've been missing in my  efforts thus far. I still don't understand why apparently so many people say they use 1x1 for L and 2x2 for R,G and B. They seem to be incompatible however you look at it.

Let's see, if everything's 1x1, then thats direct and uncomplicated. If I've got some 2x2 subs, then I need 2x2 calibration files to calibrate them, and the resulting calibrated files will be 2x2 and still not (??) compatiblle with 1x1 files.

But PixInsight can resize 2x2 files with star registration.  But aha, only image subs, not calibration files? Y/N?

I think. I guess I'm looking for magic here. It sounds like people are saying they do it. This is a heck of a complicated topic. I understand that better from what you say here, so I thank you. even though it looks like a disappointment for my plans. :tongue: :o

James

Offline ngc1535

  • PixInsight Old Hand
  • ****
  • Posts: 326
Re: converting binned 2x2 to binned 1x1
« Reply #5 on: 2018 April 23 17:10:24 »

So what people are doing is the following (I am one of the people).

1. They acquire Luminance data binned 1x1. Then they take binned color data 2x2. (Now, before the PI community rises up again me...I know the argument for just sticking with 1x1- but there is a justification in some instances for the read noise benefit.) So James, this is what you did.

2. They then calibrate their 1x1 data with 1x1 biases and darks (and flats).

3. They then calibrate their 2x2 data with 2x2 biases and darks (and flats)

4. Later, they register their CALIBRATED 1x1 data with their CALIBRATED 2x2 data (just like you want to do). I register the combined luminance to the combined RGBs..but there is a minor argument for registering to the invdividual calibrated colors...*sigh*...but it isn't critical.

Steps 2&3 are done together in at the same time when you load and use BPP properly. Technically step 4 could be part in there for further automation...but this isn't the best method.

-adam

Hello ngc1535!

Your explanation was not quite clear, but it gives me a very good idea what I'm running into here.

THANKS! :P 8)

You've brought up and pretty well explained what I've been missing in my  efforts thus far. I still don't understand why apparently so many people say they use 1x1 for L and 2x2 for R,G and B. They seem to be incompatible however you look at it.

Let's see, if everything's 1x1, then thats direct and uncomplicated. If I've got some 2x2 subs, then I need 2x2 calibration files to calibrate them, and the resulting calibrated files will be 2x2 and still not (??) compatiblle with 1x1 files.

But PixInsight can resize 2x2 files with star registration.  But aha, only image subs, not calibration files? Y/N?

I think. I guess I'm looking for magic here. It sounds like people are saying they do it. This is a heck of a complicated topic. I understand that better from what you say here, so I thank you. even though it looks like a disappointment for my plans. :tongue: :o

James

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: converting binned 2x2 to binned 1x1
« Reply #6 on: 2018 April 23 19:53:54 »
btw it would not make sense to resize the calibration frames (darks and bias anyway) because what you are doing by calibrating the images is trying to remove pixel-by-pixel variations in the response of the pixels to thermal energy (darks) and variations in how the pixels are precharged before an exposure (bias). when you do 2x2 binning in hardware, the chip sums the charge in each group of 4 neighboring pixels into a single charge and reads it out. after binning, it's impossible to recover the actual charge (or digital value) of the original 4 pixels. so while you can theoretically resize the bias and dark masters they would not actually be representative of the actual hardware, and the calibration result would be invalid.

some people do resize flats because there is a school of thought that says that the flats should be smoothed out to avoid injecting too much noise into your calibrated images. however flats also have a pixel-by-pixel meaning - the flat signal gives a measure of the variation in quantum efficiency of the pixels on your chip. dividing the light by the flat normalizes the pixel responses, making it seem as though the pixels all have equal sensitivity to light. granted this is a 2nd or 3rd order effect and may only be important if you are trying to dig out very faint signal from your images, or doing photometry... but it is a real thing.

to address the concern of noise in flats, it's best to just take a lot of them with good brightness (but not so bright that you are into the non-linear portion of the pixel response) and then average them together to boost the SNR of the master flat.

rob

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
Re: converting binned 2x2 to binned 1x1
« Reply #7 on: 2018 April 23 20:34:32 »
Dear ngc1535 and pfile, as well as adam;

I can't thank you enough for helping me understand the unknowable  :D :smiley: Your answers taken together make binning clear and also account for apparently contradictory claims by other people. My head is finally cleared out. THANK YOU SO MUCH

James

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
Re: converting binned 2x2 to binned 1x1
« Reply #8 on: 2018 April 26 09:37:39 »
Hi

Because of the insights from reading these replies, and my own experiences with processing, I've decided not to use 2x2 for anything. I liked it because it saved precious exposure time. The hassles aren't worth it, though.

I gather this is a good thing to do, too  ;D ;D

James

Offline RickS

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1298
Re: converting binned 2x2 to binned 1x1
« Reply #9 on: 2018 April 26 14:17:06 »
Because of the insights from reading these replies, and my own experiences with processing, I've decided not to use 2x2 for anything. I liked it because it saved precious exposure time. The hassles aren't worth it, though.

Binning only helps if you have a sensor that gives you a significant read noise advantage when binned (many don't) and if you are taking subs that are too short to be sky limited (which is a bad idea but unavoidable sometimes, especially for narrow band filters.)  For LRGB imaging I'd concentrate on taking subs that aren't read noise limited and forget about binning.

Cheers,
Rick.