REgular Grid Linear Interpolator.
Project description
regli
REgular Grid Linear Interpolator, capable to deal with spectral library or similar model data.
author
Bo Zhang, bozhang@nao.cas.cn
home page
install
- for the latest stable version:
pip install regli - for the latest github version:
pip install git+git://github.com/hypergravity/regli
test
from regli import test
test()
output:
regli.interp3 x 10000: 0.5675415992736816 sec
regli.interpn x 10000: 2.5326197147369385 sec
rgi x 10000: 5.4028871059417725 sec
doc
# 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.set_values(values)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
regli-0.0.3.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
regli-0.0.3-py3-none-any.whl
(5.5 kB
view details)
File details
Details for the file regli-0.0.3.tar.gz.
File metadata
- Download URL: regli-0.0.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e78f728ba56a57d383770243632bff0ea2fb0a7e29d92ad825786627670428a4
|
|
| MD5 |
8c2a645e37a926661ea0663f604ee289
|
|
| BLAKE2b-256 |
d6b8e7b94d9e8fb52fb2b27eefb80677fb5ca48fb9da7e0a505019588b528733
|
File details
Details for the file regli-0.0.3-py3-none-any.whl.
File metadata
- Download URL: regli-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a95928d7f96901110963a66845546029ec049fa4ba1d59c396e5b7b23a74729
|
|
| MD5 |
c6946711de83b2693d150deebca2a1f5
|
|
| BLAKE2b-256 |
436481d6424dbd7ff5951a072fdcb27f07d738c03a3a6a11b8b54b4f406277ce
|