ess.reflectometry.tools.scale_for_reflectivity_overlap#

ess.reflectometry.tools.scale_for_reflectivity_overlap(reflectivities, critical_edge_interval=None)[source]#

Compute a scaling for 1D reflectivity curves in a way that would makes the curves overlap. One can supply either a single curve or a collection/DataGroup of curves.

If critical_edge_interval is not provided, all curves are scaled except the data with the lowest Q-range, which is considered to be the reference curve. The scaling factors are determined by a maximum likelihood estimate (assuming the errors are normal distributed).

If critical_edge_interval is provided then all data are scaled.

All reflectivity curves must be have the same unit for data and the Q-coordinate.

Parameters:
Returns:

DataArray | DataGroup – A DataGroup with the same keys as the input containing the scaling factors for each reflectivity curve.