ess.sans.common.mask_range#

ess.sans.common.mask_range(da, mask, name=None)[source]#

Mask a range on a data array. The provided edges are used to define the ranges to be masked.

Parameters:
  • da (DataArray) – The data array to be masked.

  • mask (DataArray) – A data array defining the mask to be applied. Only one-dimensional masks are supported. The data array should contain a bin-edge coordinate which represents the edges of the ranges to be masked. The values of the data array represent the mask values (True or False) inside each range defined by the coordinate.

  • name (Optional[str], default: None) – The name of the mask to be applied. If not provided, a random name will be used.

Returns:

DataArray – A copy of the input data array with the mask applied.