xugrid.BarycentricInterpolator#
- class xugrid.BarycentricInterpolator(source: UgridDataArray, target: UgridDataArray)[source]#
The BaryCentricInterpolator searches the centroid of every face of the target grid in the source grid. It finds by which source faces the centroid is surrounded (via its centroidal voronoi tesselation), and computes barycentric weights which can be used for to interpolate smoothly between the values associated with the source faces.
- Parameters:
source (Ugrid2d, UgridDataArray)
target (Ugrid2d, UgridDataArray)
- __init__(source: UgridDataArray, target: UgridDataArray)[source]#
Methods
__init__
(source, target)from_dataset
(dataset)Reconstruct the regridder from a dataset with source, target indices and weights.
from_weights
(weights, target)regrid
(object)Regrid the data from a DataArray from its old grid topology to the new target topology.
regrid_dataarray
(source, source_dims)to_dataset
()Store the computed weights and target in a dataset for re-use.
weights_as_dataframe
()Return the weights as a three column dataframe:
Attributes
weights