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.KDTree
implementation for use with either the corner (Mesh2_node_cart_x
,Mesh2_node_cart_y
,Mesh2_node_cart_z
) or center (Mesh2_face_cart_x
,Mesh2_face_cart_y
,Mesh2_face_cart_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
k
nearest neighbors.query_radius
(xyz[, r, return_distance, ...])Queries the tree for all neighbors within a radius
r
.Attributes
tree_type