"L" flats problem.. Pleiades Astrophoto PixInsight · AstroRBA · ... · 114 · 1947 · 24

andreatax 7.72
...
· 
I'll try to follow those guidelines and see how it goes; just an aside, I wonder if some of the corner vignetting that you're seeing is the actual physical cut off of the ASI6200 as it mounts to the filter wheel? It's plain to see in all light and flat frames; it's bizzaire, but all four corners are actually slightly cut off, even thought both devices are ZWO.


If you are using 2" filters then you might have an issue there. 50mm unmounted should really be fine for a 44mm diagonal @ f/10.
Like
scotty38 1.81
...
· 
I just read through this quickly so apologies if I missed something obvious but why is a master bias being used when we have a master flat and master dark already?
Like
andreatax 7.72
...
· 
I just read through this quickly so apologies if I missed something obvious but why is a master bias being used when we have a master flat and master dark already?

Not sure it was used anywhere. I am sure I haven't.
Like
HegAstro 11.91
...
· 
·  2 likes
OK... the world does make sense, floating point math still makes sense.

Somehow, in image calibration using WBPP, I suspect the bias is being subtracted multiple times causing therefore, a division error. Here, I simply subtracted the bias from the flat, DID NOT SUBTRACT THIS BIAS FROM THE 300s DARK, and simply calibrated the lights using the raw 300 second dark, and the flat from which the bias was subtracted. Perfectly calibrated frames, no linear fit needed, no need to worry about sensor non linearity.  In thinking about Andrea's work, which motivated my effort here, what I realized is that his Linear Fit process is in effect either adding or subtracting a bias:

image.png


It think it really helps to understand how calibration works, rather than treating WBPP as a black box. For the longest time, I avoided WBPP for just this reason. Even now, there are parts of calibration I will do manually before feeding into WBPP. 

Cal_Light= (Light - Master Dark)/Calibrated Flat

Where Master Dark does not have bias subtracted from it, calibrated flat has either bias or flat dark subtracted.

There are other forms of this equation, but understanding the fundamental math and science behind calibration avoids a lot of grief.
Edited ...
Like
andreatax 7.72
...
· 
·  1 like
Indeed, all this WBPP-ing did produce a very sorry mess but I didn't expected it didn't calibrate the master flat. Yet LinearFit removes any issues without assumptions. Still, the issue with mirror flop remains.
Like
andreatax 7.72
...
· 
And I wonder whether all the other similar issues seen in the recent days might not be related to the use of WBPP...
Like
AstroRBA 1.51
...
· 
andrea tasselli:
Still, the issue with mirror flop remains.


The Optec Secondary mirror focuser should eliminate this I hope?  (whereas I'll then lock the mirror with the mirror locks - although I've heard some say that the Celestron mirror locks are not perfect?)
Like
andreatax 7.72
...
· 
·  1 like
The Optec Secondary mirror focuser should eliminate this I hope?  (whereas I'll then lock the mirror with the mirror locks - although I've heard some say that the Celestron mirror locks are not perfect?)


The Optec should really be the *preferred* way to focus a C14, aside from your current issues with flats. And, yes, I have heard they aren't perfect. Still, way better than NOT having any. I friend of mine modded his C14 with 3 spring-loaded locking prongs but maybe this is a bit stretching the envelope...
Like
jrista 8.59
...
· 
andrea tasselli:
Arun H:
Very nice work, Andrea.

It is good to be part of a thread where the problem posed is solved and we all learn something in the process.

I do have a question relating to the below statement:
The mean frame value of the lights is around 1,000 ADUs but the equivalent value for the flat is around 30,700 ADUs, that is 30x as much. In integer math this alone would be frowned upon.

Since the sensor is well behaved and linear, and since the flat is divided by its median value, why does this difference matter, so long as no pixels in the flat are saturated? It seems to me that the LinearFit process you describe simply scales the flat, but since the flat is then rescaled by its median, this step should not, in floating point arithmetic, matter at all.

Good question, Arun. But is it floating point arithmetic or is it not? In the days of yore it would have been integer arithmetic all the way but now should be FP all the way, is it not? In theory it shouldn't matter as long as the flat signal is not weaker than the mean frame value it is meant to correct but since the operation being carried out is to renormalize by the flat then the absolute value is (or should) be immaterial.

But what if the sensor in question is ever so slightly non-linear and what if this non-linearity depends on gain? This is just speculation from my part and difficult to test in non-laboratory conditions but I might have a go at it.

The non-linearity at the shallow end should be pretty short. Once your signal is above the read noise level by a sufficient degree, you should be in the linear range of the sensor.

Light signals in the non-linear range of the sensor tend to be problematic for flat calibration in general, primarily in vignetted corners. If you aren't getting sufficient signal there, then you might not really have any signal, mostly just star signal. Even if you match your flats, you'll often end up with "colored corners" where the signal levels of different channels (OSC or mono) don't match, resulting in green or often purple-colored corners.

If you are reducing your flat exposure to match your lights because both are in the non-linear range, its probably best to try and increase the exposures of both, so you get out of the non-linear range (or in other words, sufficiently swamp the read noise).
Like
jrista 8.59
...
· 
·  1 like
Arun H:
OK... the world does make sense, floating point math still makes sense.

Somehow, in image calibration using WBPP, I suspect the bias is being subtracted multiple times causing therefore, a division error. Here, I simply subtracted the bias from the flat, DID NOT SUBTRACT THIS BIAS FROM THE 300s DARK, and simply calibrated the lights using the raw 300 second dark, and the flat from which the bias was subtracted. Perfectly calibrated frames, no linear fit needed, no need to worry about sensor non linearity.  In thinking about Andrea's work, which motivated my effort here, what I realized is that his Linear Fit process is in effect either adding or subtracting a bias:

image.png


It think it really helps to understand how calibration works, rather than treating WBPP as a black box. For the longest time, I avoided WBPP for just this reason. Even now, there are parts of calibration I will do manually before feeding into WBPP. 

Cal_Light= (Light - Master Dark)/Calibrated Flat

Where Master Dark does not have bias subtracted from it, calibrated flat has either bias or flat dark subtracted.

There are other forms of this equation, but understanding the fundamental math and science behind calibration avoids a lot of grief.

Aye, calibration done improperly can lead to all manner of problems. This is where my trust of WBPP, since it is a bulk processing tool, fades. I have come across far too many threads across the web with people having problems with calibration when using WBPP.

In general, I think the following apply:

BIAS: Integrate simple average with large-sigma outlier rejection. No scaling/normalization. No weighting.

DARKS: Integrate simple average with large-sigma outlier rejection. No scaling/normalization. No weighting.

FLATS: Calibrate only with one master...either master bias, or master flat dark (if you have glows, long flat exposures, etc.) No output pedestal.
FLATS: Integrate with simple average, percentile outlier rejection. Multiplicative scaling. No weighting.

LIGHTS: Calibrate with a master dark. Don't optimize!!! Calibrate with master flat. Don't bother with a master bias, as it shouldn't be needed, the master dark will remove both bias and dark, master flat should already be calibrated.
LIGHTS: Integration can be done many ways. Generally you want to average, use additive scaling, weight according to preference. You can reject pixels according to a variety of viable pixel rejection algorithms, its worth experimenting to figure which works best for your data and approach. You can use local normalization (PI changed how this worked, so I'm no longer familiar with how to do it, but in the past it could be quite helpful if your frames had inconsistent background levels, i.e. thin patchy cloudcover or the like.) 

BIAS and DARK should be very simple. FLATS should only be calibrated with either a master bias or master dark. The only time you would ever need to use both a master bias and master dark, and calibrate the dark, is when you intend to do dark scaling (dark optimization in PI.) Its been demonstrated pretty well over the years that dark optimization can be very problematic and can INTRODUCE a lot of problems (one of the reasons I'm not a fan of WBPP, it seems to enable dark optimization by default!! Probably because it tries to use a single master dark to calibrate everything, which is simple, but most likely incorrect and ineffective in most cases.) In fact, whenever you use ImageCalibration, you should make sure you don't have the "Calibrate" checkboxes set, as that will look for a master bias, and subtract it from whatever master you are calibrating. That would generally be incorrect for the master dark unless you are optimizing (which you should generally never do), and should always be incorrect for the master flat, as flats are usually integrate with multiplicative scaling, which would result in funky results if the bias (or dark with flat darks) was not removed first. To calibrate the master flat again, would again subtract the master bias, which would be incorrect.

The impacts of these things can often be subtle...sometimes they can be quite noticeable. It depends, but this is often the root cause of many calibration issues, which seem to arise frequently with WBPP. 

I think you are on the right track now, though. Stick with the manual approach (its not really that hard, only a bit more time consuming), and i think you'll have better results in general as you go forward.
Like
HegAstro 11.91
...
· 
·  1 like
There is another reason to make sure you have adequate number of photons making up your flat. Which is that, if you want to model small changes in PRNU or changes in brightness due to dust motes, etc., then the photon signal of the flat must overcome the shot noise from that same signal such that small changes in brightness massively overcome the shot noise. I suspect this is where the 10 million or 1 millionADU originates. The absolute value of the scaled flat is irrelevant- but the number of photons that go into making the master flat do matter.
Like
jrista 8.59
...
· 
I just read through this quickly so apologies if I missed something obvious but why is a master bias being used when we have a master flat and master dark already?

See my reply above. If it is used, and the Calibrate check boxes are checked, but you are not doing Dark Optimization, then it would be a mistake. I think one of the earlier screenshots of ImageCalibration in this thread did show a master bias, as well as calibrate being checked for both the master dark and flat...and that was likely a problematic configuration. Normally, you would want a full master dark (not bias subtracted, calibrate not checked), and then a properly calibrated and integrated master flat, calibrate not checked, when using ImageCalibration on your lights.
Like
HegAstro 11.91
...
· 
·  1 like
Jon Rista:
If it is used, and the Calibrate check boxes are checked, but you are not doing Dark Optimization


Dark Optimization is, I think, one of the most ill thought out "features" made available in Calibration. They really should get rid of it completely. It is an example of the authors of PixInsight being too clever by half. The idea is to multiply your master dark by some factor such that the global noise is reduced. The problem is that you can reduce global noise, but that does not mean local, non random noise is reduced. It causes bad issues when you have patterns like amp glow or banding.
Like
jrista 8.59
...
· 
·  1 like
Arun H:
Jon Rista:
If it is used, and the Calibrate check boxes are checked, but you are not doing Dark Optimization


Dark Optimization is, I think, one of the most ill thought out "features" made available in Calibration. They really should get rid of it completely. It is an example of the authors of PixInsight being too clever by half. The idea is to multiply your master dark by some factor such that the global noise is reduced. The problem is that you can reduce global noise, but that does not mean local, non random noise is reduced. It causes bad issues when you have patterns like amp glow or banding.

Totally agree! Its one of my most-hated features. 
Like
AstroRBA 1.51
...
· 
·  3 likes
I'm blown away by the response and excellent advice/guidance in this thread!

A million thanks to everyone!
Like
 
Register or login to create to post a reply.