xoa.core.geo.GeoSelector.nearest

xoa.core.geo.GeoSelector.nearest#

GeoSelector.nearest(lon, lat, max_dist=None, workers=1)[source]#

Find the indices of the points that are the closest to target points

Parameters:
  • lon (array_like) – Target longitudes and latitudes, scalar or 1D

  • lat (array_like) – Target longitudes and latitudes, scalar or 1D

  • max_dist (float, None) – Maximal distance, in the units of the radius

  • workers (int) – Number of threads for the KD-tree, -1 for all

Returns:

  • tuple – Arrays of indices along each axis, with a size equal to the number of targets, and -1 for targets without neighbor

  • array_like – Great circle distances, inf for targets without neighbor