uxarray.Grid.get_kd_tree#
- Grid.get_kd_tree(coordinates='nodes', coordinate_system='cartesian', distance_metric='minkowski', reconstruct=False)#
Get the KDTree data structure of this Grid that allows for nearest neighbor queries (k nearest or within some radius) on either the (
node_x
,node_y
,node_z
) and (node_lon
,node_lat
), edge (edge_x
,edge_y
,edge_z
) and (edge_lon
,edge_lat
), or center (face_x
,face_y
,face_z
) and (face_lon
,face_lat
) nodes.- Parameters:
coordinates (str, default="nodes") – Selects which tree to query, with “nodes” selecting the Corner Nodes, “edge centers” selecting the Edge Centers of each edge, and “face centers” selecting the Face Centers of each face
coordinate_system (str, default="cartesian") – Selects which coordinate type to use to create the tree, “cartesian” selecting cartesian coordinates, and “spherical” selecting spherical coordinates.
distance_metric (str, default="minkowski") – Distance metric used to construct the KDTree
reconstruct (bool, default=False) – If true, reconstructs the tree
- Returns:
self._kd_tree – KDTree instance
- Return type:
grid.Neighbors.KDTree