uxarray.grid.BallTree#

class uxarray.grid.BallTree(grid, tree_type='nodes', distance_metric='haversine')#

Custom BallTree data structure written around the sklearn.neighbors.BallTree implementation for use with either the corner (Mesh2_node_x, Mesh2_node_y) or center (Mesh2_face_x, Mesh2_face_y) 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 k nearest neighbors.

query_radius(xy[, r, xy_in_radians, ...])

Queries the tree for all neighbors within a radius r.

Attributes

tree_type