Do flats need to be taken at same gain as lights?

17 replies921 views
Andy Wray avatar
Ref the above question:   

I can't think of any mathematical reason why flats need to be taken at the same gain as lights.  I tend to take them at gain 0 now, whilst the lights are at gain 139 mainly.  This allows me to at least use reasonable exposure times with my flat panel and T-shirts whilst achieving a mean ADU of 20,000.

Can anyone clarify why this may be the wrong thing for me to do as it seems to work just fine?
Well Written Concise Engaging
Björn Arnold avatar
@Freestar8n has given an explanation in a post in another thread:
https://www.astrobin.com/forum/post/62215/

Therefore, I would take them at the same settings. Just to be sure to have the same sensor conditions 

Björn
Alfonso Caschili avatar
As long as the flats are properly calibrated it should not matter.
Well Written
Andy Wray avatar
Alfonso Caschili:
As long as the flats are properly calibrated it should not matter.

This is where I am coming from.  In fact, by lowering the gain I am more likely to be in the linear operating range of the sensor.  Also, by doing so I am less likely to have issues with short exposure times and "strobing" if I can call it that of a cheap LED panel.
Chris White- Overcast Observatory avatar
While your flats dont need to have the same gain as your lights, you must calibrate your flats with a gain matched master. (either with bias or dark flats).  If you use a bias to calibrate your flats AND your lights, you might as well simplify your process and match gain on everything.

Personally, I match settings on all calibration frames and lights frames for a given project.
Helpful Concise
andrea tasselli avatar
As long as you calibrate your flats consistently the gain you use isn't an issue. In fact it wouldn't matter whether the sensor is in linear or non-linear response mode.
Well Written Concise
Andy Wray avatar
andrea tasselli:
In fact it wouldn't matter whether the sensor is in linear or non-linear response mode.


Useful to know. Thank you.
John Hayes avatar
Björn Arnold:
@Freestar8n has given an explanation in a post in another thread:
https://www.astrobin.com/forum/post/62215/

Therefore, I would take them at the same settings. Just to be sure to have the same sensor conditions 

Björn

The underlying question is a good one.  Just to review, there are three important things that flats correct:

1) Vignetting, which includes both light partially blocked by internal components in the optical train as well as dust motes.
2) Cos^4 radiometric light fall off, which is due to how irradiance decreases with field angle in any optical system.
3) Fixed pattern noise, which is due to PRNU or "photo response non-uniform.  This is simply small variations in responsivity between pixels and it's a property of the sensor itself.

When we calibrate an image, the basic idea is to first subtract the dark signal and then divide that result by the master flat.  Of course nothing is ever as simple as it seems so we have to consider how darks and bias offsets figure into the operation.  When we take the flat data that will make up the master flat file, the data will contain both dark current and the bias offset.  Here's the problem.  In order to correctly divide the flat data it must be first normalized to have values between the values of [0,1] and that means that we must FIRST remove the dark current+bias offset before doing the normalization.  Here it's important to recognize that the normalization process is exactly the same as adjusting the gain on the sensor, which means that the sensor gain doesn't matter when you take flats!  What does matter is that you take any flat-dark and/or any bias data at the same camera gain and temperature.  That's important so that you are correctly subtracting the correct amount of dark signal and/or bias offset before scaling the flat data.  Obviously if you are using a camera with negligible bias offset and exposures short enough that dark current is also negligible, you may not need to worry very much about removing that stuff from the Flat Master.

As a matter of good standard operating practice, it's always a good idea to use all the same settings on your camera when you take calibration data; but, in the case of flats, you can get often get away with using a different gain settings if you have too.   Again, that depends a little on your camera, the exposure time that you use, and whether you have or need flat-darks and bias.

John
Well Written Helpful Insightful Engaging
Andy Wray avatar
John Hayes:
What does matter is that you take any flat-dark and/or any bias data at the same camera gain and temperature.


Just for clarity for any newbies on here ... you are saying that the flat dark or bias needs to be at the same gain and offset as the flat itself; NOT the lights.  That, at least, is what I am doing.
Helpful Concise
John Hayes avatar
Andy Wray:
John Hayes:
What does matter is that you take any flat-dark and/or any bias data at the same camera gain and temperature.


Just for clarity for any newbies on here ... you are saying that the flat dark or bias needs to be at the same gain and offset as the flat itself; NOT the lights.  That, at least, is what I am doing.

Yes.  That is exactly what I am saying.  Thanks for making it clear.

John
Freestar8n avatar
I like to view astro cameras as black box devices made by humans that could be doing anything under the covers as you change settings.  So I prefer to keep everything the same for all calibration exposures and lights.  In my case with ASI1600MMPro I just use a gain setting of 100 and offset of 40 for almost everything, except very bright objects where I would use a lower gain setting.

With flats you know that if vignetting and dust donuts don't go away after calibration there is something wrong - but when it comes to correcting for PRNU the difference is more subtle and it's hard to know if somehow the flats don't match the lights properly.  As long as you dither well it probably won't matter.

There are also arguments *against* using the same gain for flats as lights, because if you use a lower gain setting you can accumulate more photons in a given number of flat exposures and the flats should be better since they have more photon counts.  But, again, if you just use more exposures at higher gain setting you should do about as well.

It's likely a camera will do just fine with gain settings different for the flats - but any time I see a button that, when pressed, causes a different code path in firmware that someone wrote - I have concern something unexpected is going on.

And just to be clear - if you use a different gain setting for flats, the bias or dark flats you use with the flats do need to match in the gain setting.  Any time you subtract one thing from another, the gain setting should be the same.

Frank
Helpful Insightful Respectful Engaging
kuechlew avatar
Apologies for rephrasing a question I asked in another thread but didn't get answered there:
How susceptible are flats to slight focus changes? If you refocus during a session and you have slight focus shifts for the same filter, do you have to take flats for each setting of the focuser or can you neglect minor focus shifts by a few focus steps?

Currently I take flats for each session and it seems ok, but I just recently acquired a focuser and don't have much experience. The focus shifts within one session so far seem to be within 30 steps of a ZWO EAF. Focus inbetween sessions varies much more, I assume due to atmospheric conditions.

Clear skies
Wolfgang
Engaging
Andy Wray avatar
How susceptible are flats to slight focus changes?


Those focus changes are so slight that they will have no impact at all as long as you have one master flat per filter.
Well Written Concise
Arun H avatar
Wolfgang - these small changes are irrelevant. I’ve very often taken flats indoors and lights outdoors with significant temperature and hence focus position differences and they have always worked without issue. What is more important with my ZWO filter wheel is to make sure it is calibrated before every session and set to  unidirectional motion. Repeatable positioning of filters is much more important than slight changes in focus position.
Well Written Helpful Insightful
kuechlew avatar
Thank you Andy, thank you Arun!

I assumed so but was not totally sure. Good to get confirmation by experienced users!

Clear skies
Wolfgang
Well Written Respectful
Andy Wray avatar
What is more important with my ZWO filter wheel is to make sure it is calibrated before every session and set to  unidirectional motion.


I would agree on the unidirectional setting, particularly if you are using small filters compared to your sensor (1.25" in my case with a 4/3rds sensor).
Well Written Concise
Jonny Bravo avatar
This question comes up a lot over on CN and both sides are argued. I use exactly the same settings in my flats as my lights for mode (unlocked or default), temperature, gain and offset. The 294MM Pro is finicky enough as it is. No need to give it an excuse _not_ to calibrate properly smile.
Related discussions
About the calibration and usage of cameras with the Gsense 4040 sensor
Dear all, for almost exactly two years now we (Dr. Karl Remeis-Observatory Bamberg) are using a Moravian C4-16000 EC which houses the Gsense 4040 sensor from Gpixel for our university astronomy lab course and public outreach purposes. Initially we ha...
Discusses sensor-specific calibration practices relevant to gain settings.
Feb 28, 2024
Flat troubles with dark corners
I'm having trouble with using flats to get flat images with a full frame sensor and 2 inch filters. Due to the large size of the of the sensor and the size of the image circle, the corners on my shots are significantly less illuminated than the c...
Flat acquisition parameters directly relevant to author's SGP flat-taking workflow.
Nov 9, 2020
Flat Frames ADU too low?
Hello guys! I am relatively new to astrophotography so i still figuring out things. One of those things is flat frames. I’ve been struggling with flat frames and i could never make them work until recently, when through experimentation, i managed to ...
Directly addresses flat frame ADU levels and exposure optimization.
Apr 26, 2024
MasterFlat Overcorrecting the Lights during calibration
Hi again, This problem of overcorrection has been a hot topic in many forums and I couldn't find any good solution after testing the various recipes read on those forums (exposure time of the flats > 5 seconds - I have been doing flats with al...
Explores gain settings in flats calibration, author's testing area.
Dec 21, 2020