uxarray.UxDataset.neighborhood

uxarray.UxDataset.neighborhood#

UxDataset.neighborhood(r=1.0)#

Groups every grid-mapped data variable by the elements within r degrees of each grid element, to be reduced over by a method of the returned DatasetNeighborhood.

Parameters:

r (float, default=1.) – Radius of the neighborhood, in degrees.

Returns:

Carrying the same reductions as UxDataArray.neighborhood(), applied to every data variable at once. Each returns a UxDataset.

Return type:

DatasetNeighborhood

Notes

Variables without a grid dimension are passed through unchanged.

Variables mapped to the same grid location share one neighbor query, so reducing a dataset costs one query per location present rather than one per variable.

Examples

Apply a mean filter to all grid-mapped variables in a dataset:

>>> import uxarray as ux
>>> uxds = ux.tutorial.open_dataset("outCSne30-vortex")
>>> uxds_smooth = uxds.neighborhood(r=5.0).mean()

See also

UxDataArray.neighborhood

Reduce a single data variable.

Grid.neighborhood

Neighborhood for one grid location, without data.

UxDataArray.zonal_mean

Average over latitude bands.

UxDataArray.azimuthal_mean

Average over rings of constant great-circle distance.