uxarray.UxDataArray.subset.nearest_neighbor#
- UxDataArray.subset.nearest_neighbor(center_coord, k, element='face centers', inverse_indices=False, **kwargs)#
Subsets an unstructured grid by returning the
kclosest neighbors from a center coordinate.- Parameters:
center_coord (tuple, list, np.ndarray) – Longitude and latitude of the center of the bounding circle
k (int) – Number of neighbors to query
element (str) – Element for use with coords comparison, one of nodes, face centers, or edge centers
inverse_indices (list[str] | set[str] | bool, optional) – Controls storage of original grid indices. Options: - True: Stores original face indices - list/set of strings: Stores specified index types (valid values: “face”, “edge”, “node”) - False: No index storage (default)