Closed gerritholl closed 5 years ago
This happens due to the rather conservative selection in https://github.com/FIDUCEO/FCDR_HIRS/blob/master/FCDR_HIRS/metrology.py#L1073:
brokenline = bad.sel(n_c=~brokenchan).any("n_e").any("n_c")
i.e., I'm rejecting a line if any pixel on any channel is bad, which may be OUTLIER_NOS. That means a single channel can spoil it for an entire orbit. But if I let them through, then outliers will mess up the cross-channel (or other) covariance matrices calculated using the same. So what is needed, is a robust version of CURUC. That is difficult and I don't have time to implement it.
This is also what is causing some FCDR processing to fail with
RuntimeError: Optimal parameters not found: Number of calls to function has reached maxfev = 400.
One way to handle this, instead of throwing out lines with at least some outliers, fill those outliers by interpolating or (even simpler) median values, only for the purposes of CURUC calculations.
Moreover, when I process a small segment only, more lines get rejected than otherwise due to the way the outlier rejection algorithm works. This happens due to the MEDMAD filter in typhon when some of the inputs are nearly constant, such that a small genuine variation is rejected as outliers.
As reported by
hirs_orbit_map
which calls (essentially)hirs_curuc_checker
, it seems in very many cases there are very many invalid lines reported. It is always well over 50%, in many cases over 90%:or
or
or