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:
reflectivities (
DataArray
|Mapping
[str
,DataArray
] |DataGroup
) – The reflectivity curves that should be scaled.critical_edge_interval (
tuple
[Variable
,Variable
] |list
[Variable
] |None
, default:None
) – A tuple denoting an interval that is known to belong to the critical edge, i.e. where the reflectivity is known to be 1.
- Returns:
DataArray
|DataGroup
– A DataGroup with the same keys as the input containing the scaling factors for each reflectivity curve.