https://github.com/johannesbuchner/regulargrid
Regular Grid Multivariate linear interpolation
https://github.com/johannesbuchner/regulargrid
Last synced: 3 months ago
JSON representation
Regular Grid Multivariate linear interpolation
- Host: GitHub
- URL: https://github.com/johannesbuchner/regulargrid
- Owner: JohannesBuchner
- License: bsd-2-clause
- Created: 2013-02-27T01:44:24.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-01-19T00:35:11.000Z (almost 11 years ago)
- Last Synced: 2024-08-11T00:04:47.394Z (about 1 year ago)
- Language: Python
- Size: 109 KB
- Stars: 21
- Watchers: 4
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
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 - Zfrom 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:
* Trilinear interpolation. (2013, January 17). In Wikipedia, The Free Encyclopedia. Retrieved 01:28, February 27, 2013, from http://en.wikipedia.org/w/index.php?title=Trilinear_interpolation&oldid=533448871
* Weiser, Alan, and Sergio E. Zarantonello. "A note on piecewise linear and multilinear table interpolation in many dimensions." MATH. COMPUT. 50.181 (1988): 189-196. http://www.ams.org/journals/mcom/1988-50-181/S0025-5718-1988-0917826-0/S0025-5718-1988-0917826-0.pdf