summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-07-09 10:47:27 +0200
committerAnton Khirnov <anton@khirnov.net>2020-07-09 10:47:27 +0200
commit1f3e3fdfe841a0fe2e2122d8e6019b974f1e354c (patch)
tree3a22431599abcfbaa1c9e1b009133ac8f5249439
parent3bc54c9a2a34a419344ae8c925d87b1efac73868 (diff)
interp: fix source index computation
-rw-r--r--interp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/interp.py b/interp.py
index c57f417..f0f5693 100644
--- a/interp.py
+++ b/interp.py
@@ -1,7 +1,7 @@
import numpy as np
def interp1d(src_start, src_step, src_val, dst_coords, stencil):
- idx_src = (dst_coords / src_step - src_start - (stencil / 2 - 1)).astype(np.int)
+ idx_src = ((dst_coords - src_start) / src_step - (stencil / 2 - 1)).astype(np.int)
src_coord = np.linspace(src_start, src_start + src_step * (src_val.shape[0] - 1),
src_val.shape[0], dtype = src_val.dtype)