ess.reflectometry.tools.combine_curves#

ess.reflectometry.tools.combine_curves(curves, qgrid=None)[source]#

Combines the given curves by interpolating them on a grid and merging them by the requested method. The default method is a weighted mean where the weights are proportional to the variances.

Unless the curves are already scaled correctly they might need to be scaled using scale_reflectivity_curves_to_overlap().

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

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

  • qgrid (Optional[Variable], default: None) – the Q-grid of the resulting combined reflectivity curve

Returns:

DataArray – A data array representing the combined reflectivity curve