wakatools.interpolation.griddata#

wakatools.interpolation.griddata(*data: DataFrame | GeoDataFrame, value: str, target_grid: DataArray, **kwargs) DataArray[source]#

Interpolate values from a Pandas DataFrame containing x,y,value for a set of points onto a target grid using SciPy’s griddata function.

Parameters:
  • data (pd.DataFrame | gpd.GeoDataFrame) – One or more DataFrame or GeoDataFrame instances containing ‘x’, ‘y’, and ‘value’ columns representing the points to interpolate from.

  • value (str) – The name of the column in data that contains the values to interpolate.

  • target_grid (xr.DataArray) – Target grid as an xarray DataArray on which to interpolate the values.

  • **kwargs – Additional keyword arguments to pass to scipy.interpolate.griddata, such as method which can be ‘linear’, ‘nearest’, or ‘cubic’. See SciPy documentation for more details.

Returns:

Interpolated values on the target grid as an xarray DataArray.

Return type:

xr.DataArray