Skip to content

JohannesBuchner/regulargrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

Regular Grid Multivariate linear interpolation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages