Commit 5e3f3f2b authored by Peter Jansweijer's avatar Peter Jansweijer

Array index error: python 3 returns <float> for width/2 while pyhton 2 returned <int>

parent 9f42c6dd
......@@ -554,11 +554,12 @@ def interpolate_axis(axis, index=None, width=3, interpolation_factor=1e5):
index_max=len(axis)-1
else:
#select part of axis
index_min=index-width/2
index_max=index+width/2
half_width = int(width/2) # python 2.x returns <int> but python 3.x returns <float>
index_min=index-half_width
index_max=index+half_width
if not width%2:
index_min+=1
#if not width%2:
# index_min+=1
if index_min < 0:
index_min=0
if index_max > len(axis)-1:
......
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