ess.reflectometry.tools.scale_reflectivity_curves_to_overlap#

ess.reflectometry.tools.scale_reflectivity_curves_to_overlap(curves, critical_edge_interval=None)[source]#

Make the curves overlap by scaling all except the first by a factor. The scaling factors are determined by a maximum likelihood estimate (assuming the errors are normal distributed).

If critical_edge_interval is provided then all curves are scaled.

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

Parameters:
  • curves (Sequence[DataArray]) – the reflectivity curves that should be scaled together

  • critical_edge_interval (Optional[tuple[Variable, Variable]], 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:

tuple[list[DataArray], list[Variable]] – A list of scaled reflectivity curves and a list of the scaling factors.