uxarray.grid.neighbors.DatasetNeighborhood

uxarray.grid.neighbors.DatasetNeighborhood#

class uxarray.grid.neighbors.DatasetNeighborhood(uxds, r=1.0)#

Neighborhood of radius r around every grid-mapped variable of a dataset, ready to be reduced over.

Carries the same reduction methods as Neighborhood, applying each to every data variable at once. Variables without a grid dimension pass through unchanged, and variables mapped to the same grid location share one neighbor query, so a reduction costs one query per location present rather than one per variable.

Returned by UxDataset.neighborhood(); not constructed directly.

Examples

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

See also

Neighborhood

The single-location neighborhood this builds on.

__init__(uxds, r=1.0)#

Methods

__init__(uxds[, r])

max()

Largest value in each neighborhood.

mean()

Mean of each neighborhood.

median()

Median of each neighborhood.

min()

Smallest value in each neighborhood.

percentile(q)

Percentile q (between 0 and 100) of each neighborhood.

ptp()

Peak-to-peak spread (max - min) of each neighborhood.

quantile(q)

Quantile q (between 0 and 1) of each neighborhood.

reduce(func)

Reduces each neighborhood with an arbitrary callable.

std([ddof])

Standard deviation of each neighborhood, with ddof delta degrees of freedom.

sum()

Sum of each neighborhood.

var([ddof])

Variance of each neighborhood, with ddof delta degrees of freedom.

Attributes

r

Neighborhood radius, in degrees.