Add similarity cuts
Created by: Zaharid
Add a cut option that throws away data such that predictions two different namespaces are too different. This used the existing cuts from intersection functionality and further refines to filter points that do not fulfill
(threshold < ratio) & (ratio < 1/threshold)
where the threshold is set as the cut_similarity_threshold
parameter
in the runcard. The two namespaces are defined as thee
cuts_intersection_spec list and the ratio is the first over the second namespace.
Some discussion:
-
This isn't the smartest code I have ever written.
-
I am using actual predictions instead of cfactors. This is because cfactors are incidental rather than physical meaningful but more importantly because it starts looking very cumbersome once one starts considering things like compound observables. I the end it pays off to do the proper job and solve the problem in general.
-
The use of central_predictions inside load is a bit of a hack, but it is not clear to me it can be done much better in a more "reportengine idiomatic" style. The logic is rather convoluted if you sit down to think about it. In any case validphys.convolution is too convenient for this to use anything else.
-
Moreover central_predictions is slow because it needs to load fktables as csv. We should probably stick calls lru_cahces in various places.
-
Tests and documentation are missing at the moment.