uxarray.Grid.subset.nearest_neighbor#
- Grid.subset.nearest_neighbor(center_coord, k, element='face centers', inverse_indices=False, **kwargs)#
Subsets an unstructured grid by returning the
k
closest 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 (Union[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)