uxarray.grid.neighbors.BallTree#
- class uxarray.grid.neighbors.BallTree(grid, tree_type='nodes', distance_metric='haversine')#
Custom BallTree data structure written around the
sklearn.neighbors.BallTreeimplementation for use with either the corner (node_lon,node_lat) or center (face_lon,face_lat) nodes of the inputted unstructured grid.- Parameters:
grid (ux.Grid) – Source grid used to construct the BallTree
tree_type (str, default="nodes") – Identifies which tree to construct or select, with “nodes” selecting the Corner Nodes and “face centers” selecting the Face Centers of each face
distance_metric (str, default="haversine") – Distance metric used to construct the BallTree
Notes
See sklearn.neighbors.BallTree for further information about the wrapped data structures.
- __init__(grid, tree_type='nodes', distance_metric='haversine')#
Methods
__init__(grid[, tree_type, distance_metric])query(xy[, k, xy_in_radians, ...])Queries the tree for the
knearest neighbors.query_radius(xy[, r, xy_in_radians, ...])Queries the tree for all neighbors within a radius
r.Attributes
tree_type