wakatools.interpolation.tin_surface#

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

Interpolate a TIN (Triangulated Irregular Network) surface from a Pandas DataFrame containing x,y,value for a set of points using a target grid. The interpolation is done by taking a weighted average of the values at the vertices of the enclosing triangle, using the barycentric coordinates. These are a weight measure for the distance of the point from each vertex. The resulting grid only contains values for each cell that falls within the convex hull of the input points because only those cells have valid barycentric coordinates.

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.

Returns:

Interpolated values on the target grid as an xarray DataArray.

Return type:

xr.DataArray