xarray.DataArray.qsel.around¶
- DataArray.qsel.around(self, radius, *, boundary=True, invert=False, drop=False, 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 byradius.If different radii are given for
kxandky, 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.boundary (
bool, default:True) – Whether to consider points on the boundary to be inside the mask. Default isTrue.invert (
bool, default:False) – IfTrue, invert the mask so that points inside are masked and points outside are kept. This is applied after the mask is created.drop (
bool, default:False) – IfTrue, drop coordinate labels along dims for which all values are masked. This argument is ignored ifaverage=True.average (
bool, default:True) – IfTrue, return the mean value of the data within the region. IfFalse, 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 ifaverage=True, else the masked data.- Return type:
Note
Depending on the radius and dimensions provided, the mask will be hyperellipsoid in the dimensions specified in
sel_kw.