uxarray.grid.neighbors.KDTree#
- class uxarray.grid.neighbors.KDTree(grid, tree_type='nodes', distance_metric='minkowski')#
Custom KDTree data structure written around the
sklearn.neighbors.KDTreeimplementation for use with either the corner (node_x,node_y,node_z) or center (face_x,face_y,face_z) nodes of the inputted unstructured grid.- Parameters:
grid (ux.Grid) – Source grid used to construct the KDTree
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="minkowski") – Distance metric used to construct the KDTree
Notes
See sklearn.neighbors.KDTree for further information about the wrapped data structures.
- __init__(grid, tree_type='nodes', distance_metric='minkowski')#
Methods
__init__(grid[, tree_type, distance_metric])query(xyz[, k, return_distance, dualtree, ...])Queries the tree for the
knearest neighbors.query_radius(xyz[, r, return_distance, ...])Queries the tree for all neighbors within a radius
r.Attributes
tree_type