Skip to main content

REgular Grid Linear Interpolator.

Project description


REgular Grid Linear Interpolator, capable to deal with spectral library or similar model data.


Bo Zhang,

home page


  • for the latest stable version: pip install regli
  • for the latest github version: pip install git+git://


from regli import test


regli.interp3 x 10000: 0.5675415992736816 sec
regli.interpn x 10000: 2.5326197147369385 sec
rgi x 10000: 5.4028871059417725 sec


# import Regli
from regli import Regli
import numpy as np

# construct grid coordinates
x1 = np.linspace(-1, 1, 30)     
x2 = np.linspace(-1, 1, 30)
x3 = np.linspace(-1, 1, 30)

# initiate regli using coordinates
regli = Regli(x1, x2, x3)

# an arbitrary function of coordinates (for demo)
f = lambda _x1, _x2, _x3: _x1 + _x2 + _x3

# regli.flats stores flattened coordinates of ND grid
flats = regli.flats
# evaluate your function on flats
values = np.array([f(*_) for _ in flats]).reshape(-1, 1)
# set values for regli

regli(pos)                      # use any of the 3 ways to interpolate
regli.interpn(pos)              # method 1 is equivalent to 2
regli.interp3(pos)              # this is accelerated for 3D

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for regli, version 2019.920.0
Filename, size File type Python version Upload date Hashes
Filename, size regli-2019.920.0.tar.gz (10.3 kB) File type Source Python version None Upload date Hashes View
Filename, size regli-2019.920.0-py3-none-any.whl (12.2 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page