uxarray.grid.neighbors.DataArrayNeighborhood#
- class uxarray.grid.neighbors.DataArrayNeighborhood(neighborhood, uxda)#
Neighborhood of radius
raround the elements of one data variable, ready to be reduced over.Carries the same reduction methods as
Neighborhood, with the data already supplied, so they take only the parameters of the reduction itself. The underlying neighbor query is built once and reused by every reduction called on this object.Returned by
UxDataArray.neighborhood(); not constructed directly.Examples
>>> import uxarray as ux >>> uxds = ux.tutorial.open_dataset("outCSne30-vortex") >>> nb = uxds["psi"].neighborhood(r=5.0) >>> smooth, spread = nb.mean(), nb.std(ddof=1)
See also
NeighborhoodThe unbound neighborhood this wraps.
- __init__(neighborhood, uxda)#
Methods
__init__(neighborhood, uxda)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
ddofdelta degrees of freedom.sum()Sum of each neighborhood.
var([ddof])Variance of each neighborhood, with
ddofdelta degrees of freedom.Attributes
gridGrid the neighborhood was built from.
grid_dimName of the grid dimension this reduces over.
Number of elements in each neighborhood.
neighborhoodThe unbound
Neighborhoodthese reductions run on.onGrid location the neighborhood is centered on.
rNeighborhood radius, in degrees.