Mastering Flat Frames (3/3): Bias, Flat-Darks and Conclusions

In a series of three blogs, I am sharing my experiences from a deep dive into mastering Flats. What started with some basic questions on what would be a good flat panel for a new large aperture telescope, and which gain and darks to use for my Flats and why, ended in multiple experiments with sometimes unexpected results.

These experiments gave a better understanding of Flat frames and helped mastering my Flat panels. Hopefully they can help you in making better informed decisions about how to take your Flat frames. In the earlier blogs we looked at Gain settings and the differences between Flat panels. Both have led to some interesting discussions on Astrobin (2x) and Cloudynights (2x). It was a great learning experience to hear about so many different ideas, insights and opinions.

In today’s article we will look into the use of Bias frames vs Flat-Dark frames. And also we will address some of the suggestions that came out of the discussions, and hopefully bring it down to some conclusions.

Bias vs. Dark

To calibrate any type of light frame, whether it is our actual sky exposure, or a flat frame, we need to subtract the noise that is generated by the sensor. Generally speaking there are two types of noise generated by the sensor. The first one is ‘read-noise’ and caused by the electronics in the sensor. It is independent of exposure. The second one is ‘dark current’. The over time random release of electrons in the absence of photons. It is influenced by sensor temperature and exposure duration.

Read-noise is measured by taking the shortest possible exposure for a camera (often 0.000032s), while blocking any light coming in. This is the Bias frame. Dark current is measured by taking a Dark frame, an exposure of the same length as the light exposures and under identical gain, offset and temperature settings. When a Bias-frame is subtracted from a Dark frame, the result is the dark current.

Bias frame: read-noise
Dark frame: read-noise + dark current

Usually the read-noise is much bigger than the dark current. Only with longer exposures, the dark current starts to play any significant role. So one would think that for Flat frames with short exposures, little dark current if any, will be present, and a Bias frame can be used for calibration. In one of Adam Block’s videos, he explains that Flats shorter than 30s can be calibrated with a Bias frame and Flats longer than 30s should be calibrated with a Dark frame (a Flat-Dark). But he also mentions that this is assuming well-behaving camera sensors. CCD sensors for example behave very linear across the exposure range, also at short exposures. CMOS sensors do not always behave that predictable. Some older sensors may suffer from amp-glow, and around second-level exposures, the cameras are far from linear. Some cameras show even higher ADU levels at 0.00032s than at 1s, as is demonstrated by John Upton.

So whether Bias can be used for Flat calibration, or whether Flat-Darks can best be applied, will depend on the camera. Every camera has its own electronic signature, and the understanding of this signature is important for decisions on how best to calibrate Flat frames.

Electronic Signature

Some experiments were conducted to understand the Electronic Signature of the ASI533MM Pro camera. The sensor in this camera is the IMX533, a modern Sony CMOS sensor from the same generation as the IMX571 (APS-C) and the IMX455 (full-frame). The Electronic Signature may still vary between these sensors of course, and also between camera brands using the same sensor. In the ‘black box’ electronics/firmware of these cameras, each manufacturer will make their own decisions, all having an effect on the Electronic Signature.

Stacks of 50 Bias frames at 32 µs were compared to stacks of 50 Dark frames at exposures varying from 0.1s to 2.5s, typical exposures for Flat frames. When comparing the Bias- and short-exposure Dark frames, it is very difficult to recognise any difference. The overall sensor/noise pattern is identical and the overall signal level is similar. The differences only become apparent when looking into the details. Below are the statistics of the Bias framesDark frames of 0.1s and 2.5s. All other variables, such as gain, offset and sensor temperature are kept the same.

Bias (32 µs)Dark (0.1s)Dark (2.5s)
Mean (ADU)198.589198.609198.361
StdDev1.1171.1652.655
Minimum (ADU)162.6164.3166.1
Maximum (ADU)226.4496.35600.9


Note that although almost identical, the Dark frame at 2.5s has a slightly lower mean ADU value than the Bias and Dark at 0.1s. As mentioned earlier, this is not uncommon for CMOS cameras and one reason to always be careful in using very short exposures. However, what is noticeable is that the Dark frames have the higher variation. The standard deviation of the mean for the 2.5s Dark is 2.6 vs 1.1 for the Bias. And also the maximum ADU value is with 5600 much higher for the 2.5s Dark than the 226 for the Bias frame.

A difference in maximum ADU value of course does not say much. Only one outlier pixel is enough to create this. There are probably much better sensor analysis tools, but an attempt was made to investigate the pattern using the PixInsight tool Script>Render>3DPlot. To look for the outliers, a mask was created that selects only the pixels, that had a value of 10 ADU above Bias in one of the Dark frames. Let’s call them ‘warm’ pixels. The resulting images have mostly 0-values and only signal at the warm pixel level. Patterns could be easier identified this way. The 3DPlot script does its own scaling as well, so by no means is this a quantitative analysis, but more a qualitative description of the patterns that take place. In the below image, the results for the Bias frame and the Dark frame at 2.5s are compared.

The pink and blue peaks indicate a pattern of warm/hot pixels that starts to emerge even when exposing just a few seconds. So would this influence the final image and if so, by how much? On one hand it is clear that there are not many and all of them are on single pixel level. So they would probably disappear with adequate dithering. On the other hand, the pattern is very clear, and it is likely to assume that also less prominent peaks (green in the above image) represent a pattern that is exposure dependent and will have its effect on the final master Flat.
A more accurate description of Bias vs Dark frames for Flat calibration might therefore be as follows, taking into account that warm and hot pixels are technically a form of dark current:

Bias frame: read-noise
Dark frame: read-noise + dark current + warm and hot pixels

So in conclusion one could say that modern sensors have very ‘clean’ bias frames and Flat frames can be calibrated with Bias frames. But the electronic signature of even very short Dark frames from tenth of seconds to several seconds is undeniable. And a proper calibration of Flat frames is best done with time-matched Dark frames, often referred to as Flat-Darks.

 

Learnings, Tips and Tricks

When starting this short sequel of blogs on mastering Flat frames, I had no idea about the level of discussions. insights and opinions I got myself into. Now, several months later, it is time to summarise some of the learnings and tips and tricks that I picked up along the way. And this last blog seems like a great place to highlight them.

One million electrons

In the second blog I mentioned how increasing the gain helped me to keep the exposure time of narrowband filters manageable. Frank Freestar8n responded saying that increasing the gain for the sake of shortening exposure time has no benefit, and he referred to the ‘1 million electron’ concept. What he referred to was the shot noise of the Flats. The shot noise is the square root of the number of electrons released in the pixel. In quantitative photometry, the target of this shot noise is 0.1%, or 1 million electrons to be counted across a stack of images. For regular astrophotography the 0.1% requirement may be too strict. Especially when dithering, a higher percentage of for example 0.1% may be ok. But it also depends on the observation conditions. Under very dark skies, most signal is from the target and 1% noise is not too bad. But under light polluted skies, 1% of background level is relatively large compared to target signal.

The number of electrons that hit each pixel in a stack of Flats can be easily calculated from the gain of a camera expressed as e-/ADU. For example, for a Gain set at 0, the ASI533MM Pro has a gain of 3.1 e-/ADU. Each Flat frame with a mean ADU of 32.500 (50% of maximum), the amount of electrons captured at each pixel is 3.1 * 32.500 = 100,750. So 10 Flat frames would be sufficient to reach 1 million electrons. But this can be very different for different cameras. In the left table below, the outcome is summarised for three different cameras that I use at two regularly used gain levels. Note that as a target 0.1% shot noise (1 Million electrons) is taken, which of course is arbitrary.

CameraGaine-/ADUTarget1 Flat#Flats for 1M
ASI53303.132,500100,75010
100132,50032,50031
QHY26801.5832,50051,35019
260.6432,50020,80048
ASI620000.832,50026,00038
1000.263,25008,450118

Number of Flats required to count 1 million electrons per pixel

What becomes apparent is that with the usual amount of 25 Flats, the above targets are only met in 2 out of 6 cases. Accepting a higher noise level will bring the required numbers down, so it is probably not a huge deal. But the main takeaway from this whole discussion is that the numbers work differently for different cameras. To get to the same noise levels, the ASI6200 requires 4 times as many flats as the ASI533. So for the QHY268 and the ASI6200 it may be good practise to increase the number of Flats to for example 50.

Camera# FlatsADUe-Noise StDev
ASI533000.6909
529,500147,5000.7192
1029,500295,0000.7157
2529,500737,5000.7149

Effect of # electrons on noise of calibrated image.
Noise values from NoiseEvaluation script in PixInsight


An additional test was done to try to quantify the effect of the cumulative amount of electrons on noise levels. The same OIII stack of 20 images was calibrated with either no Flat frame, or with Master Flats consisting of 5, 10 and 25 Flats. The noise level was assessed with the NoiseEvaluation script in PixInsight. What becomes apparent is that calibrating images with Flat frames does have a negative effect on noise. Also it demonstrates that like the theory predicts, noise decreases when more electrons are counted. And while in the available data there was no option to get to 1 million electrons, the general direction is visible. But also the effect does not seem to be too excessive.

When trying to get high electron counts, another way to get there is to increase the target illumination of the Flats. It is quite common to target between 25% and 50% of maximum illumination. But modern sensors are very linear also in higher illuminations, so exposing to 45,000 ADU or thereabout is probably fine too.

Non-uniformity

When comparing various flat-panels, one of the conclusions was that some panels were more uniformly lit than others. In subsequent comments, two tips came up. The first one is actually very simple. When rotating the Flat panel in between Flat frames, non-uniformity from the panel will be averaged out within the stack. It appears that actually quite a few people are doing this. Some rotate between each frame, while others rotate for example half-way. This probably makes a lot of sense, just to rule out the possibility that the Flat panel itself introduces artefacts in the image.

The second tip involves a quantitative assessment of the non-uniformity. In my blog I describe a qualitative comparison by subtracting Flat frames from each other. But the following method will yield the non-uniformity of a given panel as a simple %. It is a method originally developed by the AAVSO and later applied by John Upton and shared in the thread by Arun H. The method works as follows (assuming the use of PixInsight):

  1. Shoot 10 Flats (Set1)

  2. Rotate the Flat panel and shoot another 10 Flats (Set2)

  3. Integrate each stack of Flats

  4. In PixelMath divide and normalise the results: Set1 / Set2 / 2 (Diff)

  5. Run the Flat_Contour_Plot script on Diff with script parameters: 50, 2.5, 15, 50

  6. Note the numbers at the top (Max) and bottom (Min) along the right side.

  7. Calculate the total non-uniformity (NU) in the Flat as: NU = (Max - Min) / ((Max + Min)/2) * 100%

For both the Gerd Neumann Aurora panel and the Pegasus Astro Flatmaster I ran these tests. The Flatmaster had a non-uniformity of 1.8%, while the Aurora was a bit better at 1.4%. Both numbers however are very low. Comparing the Diff frames and their respective contour plots for both panels qualitatively, the Aurora gave a more uniform result, whereas the FlatMaster showed the horizontal banding and overall had a more erratic pattern. This is very similar to earlier findings.

Contour plots of Aurora (left) and FlatMaster (right) after quantitative non-uniformity assessment

Gain vs LCG- and HCG mode

In the first blog, I specifically looked at the influence of different gain settings, and concluded that gain setting did not matter that much in practical terms. But matching Low Conversion Gain / High Conversion Gain modus between Lights and Flats was very important. In several comments, suggestions were made that maybe more of a gain effect could be measured if more gain settings were tested. I’ve repeated some of those tests with additional gain settings, including a gain just before the switch to HCG mode. But all experiments pointed to the same conclusion: LCG/HCG mode should be matched, Gain not so much. In an update of the first blog, the aspect of noise in the Flat frames was addressed and indeed it looked like the noise level was a bit higher in the Flats with the high gains. With the knowledge about the ‘one million electrons’ count, as explained above, this is probably what was going on.

 

Summary

When taking Flats for a monochrome camera with narrowband and broadband filters, one of the challenges is the vastly different needs between filters. Light passing through an H-alpha or SII filter is only about 0.5% of that coming through the luminance filter. In order to take proper Flats for each filter, there are three variables to play with: Gain, Exposure and Brightness. But based on all the aspects discussed in these three blogs, there are limitations to any of these three:

Gain

After all the experiments and three blogs on the topic, I have essentially converted from a ‘no-gain matching’ to a ‘gain matching’ guy. The experiments showed that LCG- and HCG-mode should always be matched between Flats and Lights. LCG-mode means Gain 0 and HCG-mode means Gain 100 (26 for QHY camera). Those are the only two Gain settings used for Lights. Increasing the Gain in HCG mode higher than 100/26 for narrow-band filters is risking increased noise that would degrade the image so is better avoided. Pixel-Response Non-Uniformity (PRNU) although sometimes used as an argument in this discussion does not seem to have a material effect either way, although the LCG/HCG mode effect could technically be considered a PRNU effect.

Exposure

Acquisition software with automated Flat routines, will adjust exposure to reach a target ADU. While this automates the process of shooting Flats, the post-processing becomes quite cumbersome. As seen in the current blog, using Flat-Darks is preferred over using Bias. So shooting Flats with varying exposure means shooting a lot more Flat-Darks. With seven filters and 50 Darks per filter, that is 350 extra frames to take care of. It is not the end of the world of course, but just a lot to keep an eye on and an error is quickly made. Secondly the exposure range from Luminance to SII is very large. On both sides this can give problems. The very short sub-second frames of the luminance shots will likely reveal non-uniformities especially in LED panels. The very long exposures for narrow-band filters just take a long time (30-60s), especially for the generally dimmer EL panels. If you only take flats once every one-two months this is not a problem. But if you work in a non-permanent setup, Flats are ideally shot for each session and then such long Flat exposures are a problem. So Ideally Exposure is kept constant at around 1-5s.

Brightness

If Gain and Exposure are ideally kept constant within a set of Flats, brightness is the only variable that is left over. And here are significant differences between Flat panels. Some don’t allow for any Brightness control (LED tracing panel, Aurora flat panel). Others do allow Brightness control, but even in their brightest setting still require quite long exposures for narrowband (FlipFlat). And panels that have Brightness control and are sufficiently bright for narrowband, cannot always be dimmed well enough for the broadband filters (FlatMaster).

 

Conclusion

This series of blogs started because I was preparing for a new telescope to arrive, a Planewave CDK14. So what Flat panel have I decided to use for that scope, and what will be my preferred Flat process going forward?

As far as the preferred process going forward is concerned, for key components are:

  • Only Gain 0 or Gain 100 (26 for the QHY), matched with Lights (LCG/HCG-mode matching).

  • Use preferably one exposure (1-5s) for all filters

  • Use Flat-Darks for that exposure (no Bias anymore)

  • Take 25 Flats per filter for the ASI533MM and QHY286c and 50 Flats per filter for the ASI6200MM, to get close to the 1 million electrons

  • Don’t rotate the panel between exposures, but instead look for a panel with sufficient uniformity (1-2%)

  • Use a panel with dynamic Brightness adjustment, dependent on filter settings, for a fully automated Flat run

  • Do a full Flat run for each time the scopes are setup.

Currently the only panel that fulfils all of these criteria is the FlatMaster. I have been using it now with 5s exposures, but banding is still visible. So not ideal, although with the non-uniformity being 1.8% this is probably not too bad. But Brightness adjustments on the dim side are not sufficient enough, resulting in multiple exposure times in some cases. Also low level brightness settings can not be very precisely controlled.

So the quest for a proper flat panel that ticks all the boxes is still ongoing. Also, the FlatMaster does not even come in a big enough size for my needs. While I’d love an EL panel, probably none of them will be bright enough to keep exposures short. Also there are stories about EL panels getting dimmer over time, especially in the red-end of the spectrum. So a LED panel will probably be a better option. In one of the threads someone shared good experiences with the FT1 panels from DeepSkyDad. They come in 30x30cm and 60x60cm, so big enough to cover the CDK14. There is an INDI driver with dynamic Brightness control and special attention has been paid to the low light levels, resulting in a total of 4000(!) selectable brightness settings. Finally, these panels are not breaking the bank either. So I’ve place an order for a 30x30cm panel to test out and will proceed from there.

Thank you

To all the people who have responded in one forums, or on this website I would like to extend a massive ‘Thank you’. The many inputs, suggestions, knowledge, ideas that people shared have been a substantial part of this journey and shaped a lot of the experiments and insights. It is fantastic to be part of a community of astrophotographers where sharing knowledge and helping each other is so abundantly done.



Previous
Previous

Euro-EMC S130 rolling pier review

Next
Next

Mastering Flat Frames (2/3): Flat Panels compared