theochem / theochem/grid

Interpolating on Cubic Grids Using Scipy

Open
#261 2 comments 1 reaction 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.