ess.reflectometry.tools.scale_reflectivity_curves_to_overlap#

ess.reflectometry.tools.scale_reflectivity_curves_to_overlap(curves, return_scaling_factors=False)[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).

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

  • return_scaling_factor – If True the return value of the function is a list of the scaling factors that should be applied. If False (default) the function returns the scaled curves.

Returns:

list[DataArray] | list[scalar] – A list of scaled reflectivity curves or a list of scaling factors.