sisl
sisl copied to clipboard
Interpolate from grid.
I would like to add a method to interpolate values from a Grid
, given some coordinates. I have looked into it and it seems like the way to go is to use scipy.interpolate.RegularGridInterpolator
.
To clarify, the method would work something like this:
rho = sisl.Grid(...)
# Get the value of the electronic density at the points that we are interested, even
# if they are not part of the grid.
interesting_points = [[0,1.3, 4.5], [2.3, 4.7, 10]]
rho_vals = rho.interpolate(interesting_points)
(1) Do you think it makes sense?
(2) Where would you put it, given that there is already a method named interp
?