xarray.DataArray.qsel.around

DataArray.qsel.around(self, radius, *, average=True, **sel_kw)[source]

Average data within a specified radius of a specified point.

For instance, consider an ARPES map with dimensions 'kx', 'ky', and 'eV'. Providing 'kx' and 'ky' points will average the data within a cylindrical region centered at that point. The radius of the cylinder is specified by radius.

If different radii are given for kx and ky, the region will be elliptic.

Parameters:
  • radius (float | dict[Hashable, float]) – The radius of the region. If a single number, the same radius is used for all dimensions. If a dictionary, keys must be valid dimension names and the values are the radii for the corresponding dimensions.

  • average (bool, default: True) – If True, return the mean value of the data within the region. If False, return the masked data.

  • **sel_kw – The center of the spherical region. Must be a mapping of valid dimension names to coordinate values.

Returns:

DataArray – The mean value of the data within the region.

Return type:

DataArray

Note

The region is defined by a spherical mask, which is generated with erlab.analysis.mask.spherical_mask(). Depending on the radius and dimensions provided, the mask will be hyperellipsoid in the dimensions specified in sel_kw.