ratt-ru / QuartiCal

CubiCal, but with greater power.
MIT License
8 stars 4 forks source link

Elliptical MAD #224

Closed JSKenyon closed 1 year ago

JSKenyon commented 1 year ago

This PR changes the MAD code in a few ways. Firstly, it now correctly combines the real and imaginary parts when thresholding i.e. the threshold will now be elliptical instead of a box cut. This probably won't make a huge difference, but it is more correct. Secondly, the max_deviation parameter now uses a simple mean and standard deviation calculation. This makes sense as we don't actually know the distribution of the MAD estimates themselves. What we do know is that they should be relatively unbiased as they are resilient against outliers, and in the perfect case they should all be almost equal. Consequently, the max deviation parameter will now control the level at which an entire baseline is considered untrustworthy.