Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phtrempe/sknni
Spherical k-nearest neighbors interpolation (geospatial interpolator)
https://github.com/phtrempe/sknni
algorithm geospatial interpolation interpolator k-nearest-neighbors knn sphere spherical
Last synced: 2 days ago
JSON representation
Spherical k-nearest neighbors interpolation (geospatial interpolator)
- Host: GitHub
- URL: https://github.com/phtrempe/sknni
- Owner: PhTrempe
- License: mit
- Created: 2019-02-25T21:08:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-09T00:25:16.000Z (over 2 years ago)
- Last Synced: 2024-10-31T12:14:26.309Z (15 days ago)
- Topics: algorithm, geospatial, interpolation, interpolator, k-nearest-neighbors, knn, sphere, spherical
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 6
- Watchers: 0
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SkNNI
SkNNI (pronounced "skinny") stands for spherical k-nearest neighbors
interpolation and is a geospatial interpolator.## Setup
SkNNI may simply be installed from PyPI using `pip`.
```
pip install sknni
```## Example
Here's a short usage example.
```python
import numpy as npfrom sknni import SkNNI
if __name__ == '__main__':
observations = np.array([[30, 120, 20],
[30, -120, 10],
[-30, -120, 20],
[-30, 120, 0]])
interpolator = SkNNI(observations)
interp_coords = np.array([[30, 0],
[0, -120],
[0, 0],
[0, 120],
[-30, 0]])
interpolation = interpolator(interp_coords)
print(interpolation)
# Output:
# [[ 30. 0. 9.312546]
# [ 0. -120. 14.684806]
# [ 0. 0. 12.5 ]
# [ 0. 120. 10.315192]
# [ -30. 0. 16.464548]]
```