uxarray.UxDataset.neighborhood#
- UxDataset.neighborhood(r=1.0)#
Groups every grid-mapped data variable by the elements within
rdegrees of each grid element, to be reduced over by a method of the returnedDatasetNeighborhood.- 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 aUxDataset.- Return type:
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.neighborhoodReduce a single data variable.
Grid.neighborhoodNeighborhood for one grid location, without data.
UxDataArray.zonal_meanAverage over latitude bands.
UxDataArray.azimuthal_meanAverage over rings of constant great-circle distance.