diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-07-09 10:47:27 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-07-09 10:47:27 +0200 |
commit | 1f3e3fdfe841a0fe2e2122d8e6019b974f1e354c (patch) | |
tree | 3a22431599abcfbaa1c9e1b009133ac8f5249439 | |
parent | 3bc54c9a2a34a419344ae8c925d87b1efac73868 (diff) |
interp: fix source index computation
-rw-r--r-- | interp.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |