_interpolate_multikeys(self, x, y, tri_index=None, return_keys=('z',))
_interpolate_multikeys
is a wrapper around method _interpolate_single_key
(to be defined in the child subclasses). `_interpolate_single_key actually performs the interpolation, but only for 1-dimensional inputs and at valid locations (inside unmasked triangles of the triangulation).
The purpose of _interpolate_multikeys
is to implement the following common tasks needed in all subclasses implementations:
calculation of containing triangles
dealing with more than one interpolation request at the same location (e.g., if the 2 derivatives are requested, it is unnecessary to compute the containing triangles twice)
scaling according to self._unit_x, self._unit_y
dealing with points outside of the grid (with fill value np.nan)
dealing with multi-dimensional x, y arrays: flattening for _interpolate_params
call and final reshaping.
(Note that np.vectorize could do most of those things very well for you, but it does it by function evaluations over successive tuples of the input arrays. Therefore, this tends to be more time consuming than using optimized numpy functions - e.g., np.dot - which can be used easily on the flattened inputs, in the child-subclass methods _interpolate_single_key
.)
It is guaranteed that the calls to _interpolate_single_key
will be done with flattened (1-d) array-like input parameters x, y and with flattened, valid :None:None:`tri_index`
arrays (no -1 index allowed).
x and y coordinates where interpolated values are requested.
Array of the containing triangle indices, same shape as x and y. Defaults to None. If None, these indices will be computed by a TriFinder instance. (Note: For point outside the grid, tri_index[ipt] shall be -1).
Defines the interpolation arrays to return, and in which order.
Each array-like contains the expected interpolated values in the order defined by return_keys parameter.
Versatile (private) method defined for all TriInterpolators.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them