kwant.plotter.
mask_interpolate
(coords, values, a=None, method='nearest', oversampling=3)[source]¶Interpolate a scalar function in vicinity of given points.
Create a masked array corresponding to interpolated values of the function at points lying not further than a certain distance from the original data points provided.
An array with site coordinates.
An array with the values from which the interpolation should be built.
Reference length. If not given, it is determined as a typical nearest neighbor distance.
Passed to scipy.interpolate.griddata
: “nearest” (default), “linear”,
or “cubic”
Number of pixels per reference length. Defaults to 3.
The interpolated values.
The real-space coordinates of the two extreme ([0, 0] and [-1, -1])
points of array
.
Notes
min and max are chosen such that when plotting a system on a square lattice and oversampling is set to an odd integer, each site will lie exactly at the center of a pixel of the output array.
When plotting a system on a square lattice and method is “nearest”, it
makes sense to set oversampling to 1
. Then, each site will
correspond to exactly one pixel in the resulting array.