ess.beer.conversions.compute_tof_in_each_cluster#
- ess.beer.conversions.compute_tof_in_each_cluster(da, mod_period)[source]#
Fits a line through each cluster, the intercept of the line is t0. The line is fitted using linear regression with an outlier removal procedure.
The algorithm is: :rtype:
DetectorTofData
[TypeVar
(RunType
)]Use least squares to fit line through clusters.
Mask points that are “outliers” based on the criteria that they are too far from the line in the
t
variable. This means they don’t seem to have the same time of flight origin as the rest of the points in the cluster, and probably should belong to another cluster or are part of the background.Go back to 1) and iterate until convergence. A few iterations should be enough.