avni.mapping.common module#

avni.mapping.common.interp_weights(xyz, uvw, d: int = 3)[source]#

Get weights for interpolation

First, a call to scipy.spatial.qhull.Delaunay() is made to triangulate the irregular grid coordinates. Second, for each point in the new grid, the triangulation is searched to find in which triangle (actually, in which simplex, which in your 3D case will be in which tetrahedron) does it lay. Third, barycentric coordinates of each new grid point with respect to the vertices of the enclosing simplex are computed.

From: http://stackoverflow.com/questions/20915502/speedup-scipy-griddata-for-multiple-interpolations-between-two-irregular-grids

Parameters
xyz

Locations of an irregular grid

uvw

Locations to find

dint, optional

Some integer that probably denotes dimensions, by default 3

Returns
vertices, weights

Vertices of the simplex and weights to use

avni.mapping.common.interpolate(values, vtx, wts, fill_value=nan)[source]#

Interpolate based on values, faster form of scipy.interpolate.griddata()

An interpolated values is computed for that grid point, using the barycentric coordinates, and the values of the function at the vertices of the enclosing simplex.

From: http://stackoverflow.com/questions/20915502/speedup-scipy-griddata-for-multiple-interpolations-between-two-irregular-grids

Parameters
values

_description_

vtx_type_

_description_

wts_type_

_description_

fill_value_type_, optional

_description_, by default np.nan

Returns
_type_

_description_