Colour Matched DSLR Flats
Introductory Comments
This article describes an advanced technique for shooting calibration flats with DSLR and Mirrorless cameras to overcome the peripheral colour shifts sometimes found in calibrated exposures.
Example of Problem
Here is an image I took of Lynd's Dark Nebula 1251 on a reasonably dark night (SQM 21.4 i.e Bortle 3) with an unmodified Nikon Z6 camera on a Tak Epsilon 180ED. It used 2min subs at ISO 3200. The image has been calibrated, stacked. Pixinsight ABE (background extraction) with function degree 1 was applied to subtract the background light pollution, followed by ArcsinhStretch.
Note the purple colour cast towards the edges:
For reference here is an out-of-camera JPG from that imaging session:
The flats used were dusk sky flats. Here is an out-of-camera JPG of one of those flats:
Another example of the problem is this one taken with a Canon EOS R on the same telescope, using 2min subs at ISO 1600:
The exposures were all calibrated with dusk sky flats and then stacked. As with the example above, Pixinsight ABE (background extraction) with function degree 1 was applied to subtract the background light pollution, followed by ArcsinhStretch.
Investigation of Problem
I found I was able to reproduce the problem by taking artificial flats whose colour and intensity matched the original lights and the original flats by using a computer monitor as the light source and changing the colour and brightness appropriately:
By bias-subtracting the raw files, dividing one by the other (as done during standard calibration), the result showed the same purple colour cast towards the edges, despite the noise:
Cause of Problem
The cause of the problem is two-fold:
- Non-linearity of the pixel response
- Colour pixel cross-talk
Clearly this causes unwanted colour mixing. The probability of a photon being affected by pixel crosstalk depends on its wavelength and its angle of incidence at the sensor. The net effect of this is what's known as colour shading i.e. the tendency of colour biases appearing towards the corners of an image. For terrestrial photography, this effect is most noticeable when taking terrestrial pictures with a fairly uniform background such as large areas of snow, water or sky.
The end result of non-linearity and pixel crosstalk is that flat frames of one colour (e.g. blue or white) do not properly correct light frames of another colour (e.g. orange/brown light pollution). It should also be pointed out that non-linearity also affects mono sensors as well as one-shot-colour sensors.
An example of non-linearity
Here is an example of the problem caused by non-linearity. This was an experiment with the Canon EOS R where I have divided two (bias-subtracted) raw ISO 1600 sky flats shot in quick succession at different exposure levels:
The background colour in each exposure was identical and therefore any potential crosstalk effects would have been identical. The result has been highly stretched in order to show the effect, so although it looks dramatic the actual non-linearity is less than 1%. But 1% is enough to cause quite serious calibration difficulties for integration times of many hours where strong stretching is required to reveal faint details.
It was suggested to me by a participant on the Cloudy Nights forum that an inaccuracy in the bias level might cause this. However, it's easy to see why this is not the case. In the above sky flats, it so happens that in each flat the blue and green channels have similar raw values but the values in the red channel are much lower. I certainly agree that by playing with the bias level you can trigger undercorrection or overcorrection when dividing one (bias-subtracted) flat by the other.
If I increase the bias level by a small amount I can prevent overcorrection in the blue& green channels but then the red channel undercorrects. Increasing the bias further makes all channels undercorrect.
Conversely if I decrease the bias level by a small amount I can prevent undercorrection in the red channel but then the blue&green channels overcorrect. Decreasing the bias further makes all channels overcorrect.
So adjusting the bias level cannot prevent the observed blueish green tint towards the edges of the sensor in the calibrated frames.
Solution to the Problem
The solution to the problem is to shoot colour-matched flats i.e. flats with the same colour and intensity as the background of the light frames, typically orange/brown light pollution. As ablove, this can be done by using a computer monitor as the light source and adjusting the displayed colour as appropriate. Shooting the same colour addresses the pixel cross-talk and shooting the same intensity addresses the non-linearity.
Here is the original Nikon Z6 example but this time calibrated with colour-matched flats:
Here is the original again, for comparison:
The difference between the two is quite dramatic.
Here is the original Canon EOS R example but this time calibrated with colour-matched flats:
Here is the original again, for comparison:
Again, the difference between the two is quite clear.
A Final Example
A final example of where colour-matched flats were effective is this image taken with the Sony A7S:
This image used dusk sky flats which of course are blueish instead of the brown (light pollution) background of the light frames. Obviously the image is very highly stretched in order to bring out the IFN (integrated flux nebulosity) in the background. Note the weird vertical green swathe in the left hand quarter of the image adjacent to the purple swathe in the background of the M81 and M82 galaxies.
I never managed to understand the cause of those coloured vertical swathes but the good news is that colour-matched flats fixed the problem!
Conclusion
At the time of writing (April 2023), this is not an issue that's widely recognised by the astro-community but it's something I've noticed on two cameras (Nikon Z6 and Canon EOS R) when used with my Takahashi Epsilon 180ED telescope. In both cases, using colour-matched flats made a huge difference and made further gradient removal much simpler.
Last updated by Mark Shelley: 2 April 2023 (astro@markshelley.co.uk)