Interpolating on Cubic Grids Using Scipy
Open
@shubhamachary56821 is already working on this.
Since Mar 25, 2025.
good first issue
- Dominant language
- Python
- Stars
- 101
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Rather than re-inventing the wheel, Scipy has interpn that only works on regular grids (grid axes are orthogonal to coordinate axes) and offers many different kinds of interpolating "linear”, “nearest”, “slinear”, “cubic”, “quintic”, “pchip”, and “splinef2d”. “splinef2d” i"
The following code shows how easy it is using Grid to incorporate inside UniformGrid (assuming grid axes are orthogonal)
x, y, z = grid_cube.get_points_along_axes()
electro = interpn((x, y, z), electro_cube, kverts, method="linear")#method="cubic", bounds_error=True)
print("Electro static mean, std, min, max", electro,np.mean(electro), np.std(electro), np.min(electro), np.max(electro))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.