Author Topic: Color balance in Flats: Important?  (Read 6390 times)

Offline bhwolf

  • Member
  • *
  • Posts: 53
Color balance in Flats: Important?
« on: 2014 February 25 16:30:42 »
I image with a DSLR and often with a Hyperstar, and as such, vignetting is a problem.  The info Gerald posted here in this thread was really useful:

http://pixinsight.com/forum/index.php?topic=6210.0

And got me into playing around with PixelMath to better understand and tweak applying flats to my images.  My flats never seem to work well, and it has me wondering if color balance of the flats matter as I usually take sky flats, often with a CLS filter (very blue).   My images often look like Hytham's in the above thread except in RGB.  What surprised me, though, was that when I apply the flat via PixelMath with NO debayering, the result is good -- as you can see in the image below (top/back is light, middle is flat, and bottom is after applying light-dark / flat-bias).

I'm not exactly sure why it looks quite flat in grayscale, but has me wondering if I need a more well-balanced flat. IIRC, the conventional thought was that it didn't really matter, but I'm not so sure.  Opinions?

Thanks!
Brian









Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Color balance in Flats: Important?
« Reply #1 on: 2014 February 25 18:38:47 »
if i understand it correctly, flat calibration of OSC images is done on a per-channel basis. that is, a scaling factor is computed for each channel independently of the others. i think this is the method described in Handbook of Astronomical Image Processing.

so that means that the overall color of a flat is not important, as long as each channel is "well exposed".

when i used a DSLR and a CLS filter, the red channel in my flats was almost always underexposed due to the color cast of the CLS, such that it made it impossible to get a well-exposed red channel while still keeping the blue channel in the linear range of the sensor. in the end the only way to combat this was to shift my flat light source to the pink - i used to do t-shirt flats and so i used a slightly pink t-shirt. this worked well to keep the 3 channels reasonably in balance so that they could all be simultaneously well-exposed.

rob

Offline Phil Leigh

  • PixInsight Addict
  • ***
  • Posts: 220
Re: Color balance in Flats: Important?
« Reply #2 on: 2014 February 26 03:08:47 »
Rob is correct - the absolute colour balance makes no difference PROVIDED all three channels are adequately exposed.
You do not debayer OSC/CFA (e.g. normal DSLR) flats... the individual flats are calibrated with the master bias and (usually scaled) Master Dark and then integrated to create the Master Flat...

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Color balance in Flats: Important?
« Reply #3 on: 2014 February 26 07:19:25 »
Hi Brian!
To get the flat adequately exposed with OSC - it helps to use a true white light source.
I know only one on the market. It is from Alnitak http://alnitakastro.com/
We are using this light source which really delivers true white light und gets you
not 3 histogram bumps in the raw flat but only one histogram bump.
Using correct light source enables better flats. Better flats reduces image processing by 1 trouble... (and there are many)
Using skyflats with a modified camera gets the red channel in the calibrated image to far to the right of the histogram
what i would also call    " using a not adequately exposed flat" .

There is a software help in PI using Process ChannelMatch. With ChannelMatch you can move all 3 channels of your
raw image by 0.5 Pixels. This averages the gray Colorpixels in the raw image and brings the 3 histogram bumps nearer together
to have only one histogram bump afterwards. Also the size of the image is not changed.
How do i do this:
1.) convert rawflat to type RGB  (it still stays gray no change happens) this is needed to use ChannelMatch as ChannelMatch works only with RGB images.
2. ChannelMatch Change all Channels 0.5 Pixels  in X and Y. 
3) convert Output of 2. back to Gray again.
   And your flat is better usable than untreated.
   But better in any case would be using a "true white light source".
find a screenshot showing the 3 steps attached.

also the process-container
https://dl.dropboxusercontent.com/u/57910417/Flatkorr.zip

Gerald

« Last Edit: 2014 February 26 07:33:20 by oldwexi »

Offline Phil Leigh

  • PixInsight Addict
  • ***
  • Posts: 220
Re: Color balance in Flats: Important?
« Reply #4 on: 2014 February 26 07:37:08 »
Many folks that use OSC also use LP filters... and it doesn't matter how white the light source is, the flats will not be white...
I use a Gerd Neumann EL panel and IDAS D1 filter (unless I am shooting narrowband) and my red channel is always a little lower than green and blue. However with a DSLR the linear range is quite broad.

Gerald - is this channel match process designed to work on the master flat?

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Color balance in Flats: Important?
« Reply #5 on: 2014 February 26 09:28:56 »
right - because of the LP filter you need to somehow skew your light source toward the red if you want "white" flats...

rob

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Color balance in Flats: Important?
« Reply #6 on: 2014 February 26 10:21:39 »
Many folks that use OSC also use LP filters... and it doesn't matter how white the light source is, the flats will not be white...
I use a Gerd Neumann EL panel and IDAS D1 filter (unless I am shooting narrowband) and my red channel is always a little lower than green and blue. However with a DSLR the linear range is quite broad.

Gerald - is this channel match process designed to work on the master flat?
Hi Phil!
These steps should work on the single raw flats and also on the MasterFlat as this is also an undebayered "calibrated, stacked" raw gray image.
The ChannelMatch i think is not especially designed for flats, i think ist misused by me. I think it should help
to move a single Color channel in subpixel steps to correct atmosperic Aberration.

We have also tried Neumanns foil, but it is  to red, so after calibration red is to low, blue and green to high, therefore
we moved to the Alnitak light source which is white and can be dimmed via SW extremely,
so 5 seconds flats ar possible.

Gerald

Offline bhwolf

  • Member
  • *
  • Posts: 53
Re: Color balance in Flats: Important?
« Reply #7 on: 2014 February 26 11:04:06 »
Excellent -- thanks Gerald!

Bear with me as my understanding of this comes together.  :)  I did an experiment before I returned here and read your post.   I noticed when looking at the master flat file it has a "checkerboard" look to it.  I realized this is likely the bayer pattern I'm seeing (see attached), blue being the bright pixel, the two green on diagonals and red near black... does this sound correct?

I ran an atrous transform and removed small scale structures in the flat to smooth it out.  This is not as robust as your method -- but the calibrated images were improved. 

Thanks much -- this is really valuable learning.

Brian

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Color balance in Flats: Important?
« Reply #8 on: 2014 February 27 05:06:18 »
Bear with me as my understanding of this comes together.  :)  I did an experiment before I returned here and read your post.   I noticed when looking at the master flat file it has a "checkerboard" look to it.  I realized this is likely the bayer pattern I'm seeing (see attached), blue being the bright pixel, the two green on diagonals and red near black... does this sound correct?
Hi Brian, yes, exactly.

Great that your calibratetd images look better now.
Gerald

Offline Tom OD

  • PixInsight Enthusiast
  • **
  • Posts: 88
Re: Color balance in Flats: Important?
« Reply #9 on: 2014 March 01 07:33:09 »

There is a software help in PI using Process ChannelMatch. With ChannelMatch you can move all 3 channels of your
raw image by 0.5 Pixels. This averages the gray Colorpixels in the raw image and brings the 3 histogram bumps nearer together
to have only one histogram bump afterwards. Also the size of the image is not changed.
How do i do this:
1.) convert rawflat to type RGB  (it still stays gray no change happens) this is needed to use ChannelMatch as ChannelMatch works only with RGB images.
2. ChannelMatch Change all Channels 0.5 Pixels  in X and Y. 
3) convert Output of 2. back to Gray again.

Can I used this method to an RGB image before I extract the Synth Lum for it. I read in another post that you need to balance the RGB weights before extraction of the CIE L frame.
Tom.



Offline Phil Leigh

  • PixInsight Addict
  • ***
  • Posts: 220
Re: Color balance in Flats: Important?
« Reply #10 on: 2014 March 01 08:32:57 »

There is a software help in PI using Process ChannelMatch. With ChannelMatch you can move all 3 channels of your
raw image by 0.5 Pixels. This averages the gray Colorpixels in the raw image and brings the 3 histogram bumps nearer together
to have only one histogram bump afterwards. Also the size of the image is not changed.
How do i do this:
1.) convert rawflat to type RGB  (it still stays gray no change happens) this is needed to use ChannelMatch as ChannelMatch works only with RGB images.
2. ChannelMatch Change all Channels 0.5 Pixels  in X and Y. 
3) convert Output of 2. back to Gray again.

Can I used this method to an RGB image before I extract the Synth Lum for it. I read in another post that you need to balance the RGB weights before extraction of the CIE L frame.
Tom.



The way to do that is by using the Colour spaces - RGBWorkingSpace process and setting the r, g and b coefficients all to 1.

Offline Tom OD

  • PixInsight Enthusiast
  • **
  • Posts: 88
Re: Color balance in Flats: Important?
« Reply #11 on: 2014 March 01 13:03:35 »
Thanks Phil