xoa.geo.GeoKDTree.query_radius#
- GeoKDTree.query_radius(target, radius, units='m', output='index', workers=1)[source]#
Find the neighbors of target points within a distance
- Parameters:
target (xarray.DataArray, xarray.Dataset, tuple) – Object with longitude and latitude coordinates, or a (lon, lat) pair of scalars or 1D arrays
radius (float) – Maximal distance
units (int, str, distance_units) – Units of radius and of the returned distances, as one of:
0|"m"|"meters"|"meter",1|"km"|"kilometers"|"kilometer"output ({"index", "dist", "mask"}) – Return the indices of the neighbors of each target, or a distance or mask array on the points of obj.
workers (int) – Number of threads, -1 for all
- Returns:
list – With
output="index", a list with one item per target point, in the flattened order, which is a dict of indices along aneighbordimension for each dimension of the longitudes and latitudes of obj. They are suited for pointwise selection withxarray.DataArray.isel().xarray.DataArray – With
output="dist", the distance to the closest target on the points of obj that are within radius of at least one target, and nan elsewhere. Withoutput="mask", the boolean array of these points.