JohannesBuchner/regulargrid

Regular Grid Multivariate linear interpolation
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
regulargrid
test
.gitignore
CHANGES.txt Feb 27, 2013
MANIFEST.in
setup.py Jan 19, 2015

Regular Grid Multivariate linear interpolation

Non-recursive implementation of linear interpolation on regular grids.

Usage

• Code from this project has been integrated into scipy v0.14.0. See scipy.interpolate.RegularGridInterpolator.

• Cartesian grid regulargrid.cartesiangrid.CartesianGrid (equal spacing between points)

Uses very fast implementation based on scipy.ndimage.map_coordinates

Example:

```# create a 3-dimensional cartesian grid:
limits = [(0, 1), (0, 1), (0, 1)]
x = numpy.linspace(0, 1, 8)
y = numpy.linspace(0, 1, 9)
z = numpy.linspace(0, 1, 10)

Z, Y = numpy.meshgrid(z, y)
X = numpy.array([[x]]).transpose()

# our grid values
values = X**2 + Y - Z

from regulargrid.cartesiangrid import CartesianGrid
# does linear interpolation
grid = CartesianGrid(limits, values)

# interpolate for one point
print grid([0.1], [0.5], [0.3])
# interpolate many
print grid([0.1, 0.3], [0.5, 0.5], [0.3, 0.2])
```
• Regular grid regulargrid.regulargrid.RegularGrid (unequal spacing between points)

Get

via pip/easy_install from PyPI:

```pip install regulargrid
```

Source hosted at Github

References:

You can’t perform that action at this time.