Commit 5c69c519 authored by Reimar H Leike's avatar Reimar H Leike
Browse files

linear interpolation is now including all boundaries

parent f97a9502
...@@ -55,6 +55,10 @@ class LinearInterpolator(LinearOperator): ...@@ -55,6 +55,10 @@ class LinearInterpolator(LinearOperator):
pos = positions/dist pos = positions/dist
excess = pos-pos.astype(int64) excess = pos-pos.astype(int64)
pos = pos.astype(int64) pos = pos.astype(int64)
mask = (excess == 0.) & (pos != 0)
pos[mask] -= 1
excess[mask] += 1
del mask
data = zeros((len(mg[0]), N_points)) data = zeros((len(mg[0]), N_points))
ii = zeros((len(mg[0]), N_points), dtype=int64) ii = zeros((len(mg[0]), N_points), dtype=int64)
jj = zeros((len(mg[0]), N_points), dtype=int64) jj = zeros((len(mg[0]), N_points), dtype=int64)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment