ess.reflectometry.tools.combine_curves#

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

Combines the given curves by interpolating them on a 1d grid defined by q_bin_edges and averaging over the provided reflectivity curves.

The averaging is done using 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() before calling this function.

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

Parameters:
Returns:

DataArray – A data array representing the combined reflectivity curve