Skip to content

Latest commit

 

History

History
81 lines (60 loc) · 2.61 KB

README.md

File metadata and controls

81 lines (60 loc) · 2.61 KB

TFInterpy

TFInterpy is a Python package for spatial interpolation. A high-performance version of several interpolation algorithms is implemented based on TensorFlow. Including parallelizable IDW and Kriging algorithms. So far, tfinterpy is the fastest open source Kriging algorithm, which can reduce the operation time of large-scale interpolation tasks by an order of magnitude

Link to our paper

TFInterpy: A high-performance spatial interpolation Python package
(https://doi.org/10.1016/j.softx.2022.101229)

Performance comparison (unit: second)

Grid size GeostatsPy-OK PyKrige-OK TFInterpy-OK TFInterpy-TFOK(GPU) TFInterpy-TFOK(CPU)
1x104 23.977 1.258 0.828 2.070 0.979
1x105 230.299 12.264 8.140 6.239 2.067
1x106 2011.351 121.711 82.397 45.737 11.683
1x107 2784.843 1250.980 849.974 452.567 112.331

Screenshots

Snapshot of GUI tool. Snapshot of GUI tool

Requirements

Minimum usage requirements: Python 3+, Numpy, SciPy

TensorFlow based algorithm: TensorFlow 2

GSLIB file support: Pandas

3D visualization: VTK

GUI Tool: PyQT5


Usage

Install tfinterpy

pip install tfinterpy

Then install dependencies

Full dependencies : (To avoid package version issues, the specific version numbers tested in Python3.9 are listed here)

pip install matplotlib==3.9.4
pip install numpy==2.0.2
pip install pandas==2.2.3
pip install PyQt5==5.15.11
pip install scipy==1.13.1
pip install tensorflow==2.18.0
pip install vtk==9.4.1

Notice! You may do not need to install all dependencies

  • If you only need to use the most basic interpolation algorithm, install the following package. (see "examples/" for usage)
    pip install numpy==2.0.2
    pip install scipy==1.13.1
    
  • If you need to use TensorFlow-based interpolation algorithms, you need to install tensorflow. (see "examples/tf" for usage)
    pip install tensorflow==2.18.0
    
    or (Use GPU for computing)
    pip install tensorflow-gpu==2.18.0
    
  • If you need to use the built-in GUI tools (see "examples/gui" for usage) provided, please install full dependencies as above list.

Run examples

All of the sample code can be found in the "examples" folder, the examples directory is recommended as the working directory.

netCDF4 needs to be installed first to load the data.

pip install netCDF4==1.7.2