dycove.utils.plotting.create_nn_interpFunc

dycove.utils.plotting.create_nn_interpFunc(x_coords, y_coords, grid_size, k_nn=1, polygon_csv=None, extents=None)[source]

Creates a nearest-neighbor interpolator function for a fixed grid.

Parameters:
  • coords (list) – List of (x, y) coordinate pairs.

  • grid_size (int) – Desired grid cell size for interpolation.

  • k_nn (int) – Number of nearest neighbors to use (typically 1 or 3).

  • polygon_csv (Path or str) – Path to csv file containing polygon vertices (columns: x, y). If provided, values outside the polygon will be masked as NaN.

  • extents (list or tuple) – Manual x- and y-extent limits for the interpolation grid. Example: extents=(10, 50, 20, 80). If None, defaults to the min/max of the input coords.

Return type:

Function that can be used to interpolate new z values efficiently.