invert4geom.normalized_mindist

invert4geom.normalized_mindist#

normalized_mindist(points, grid, low=None, high=None, mindist=None, region=None)[source]#

Find the minimum distance between each grid cell and the nearest point. If low and high are provided, normalize the min dists grid between these values. If region is provided, all grid cells outside region are set to a distance of 0.

Parameters:
  • points (DataFrame) – coordinates of the points

  • grid (DataArray) – gridded data to find min dists for each grid cell

  • low (float | None) – lower value for normalization, by default None

  • high (float | None) – higher value for normalization, by default None

  • mindist (float | None) – the minimum allowed distance, all values below are set equal to, by default None

  • region (list[float] | None) – bounding region for which all grid cells outside will be set to low, by default None

Returns:

grid of normalized minimum distances

Return type:

DataArray