Skip to content
Snippets Groups Projects
Commit 808ea36b authored by Francois POLACK's avatar Francois POLACK
Browse files

fix: bugs in new spline_interpolate function

parent ad6d963b
No related branches found
No related tags found
No related merge requests found
......@@ -235,11 +235,12 @@ def spline_interpolate(data, rowwise=True, window=('tukey', 0.2) ):
if rowwise:
segment_size=data.shape[1]
segment_num=data.shape[0]
windata=data*scipy.signal.get_window(window, segment_size)
else:
segment_size=data.shape[0]
segment_num=data.shape[1]
windata=data*scipy.signal.get_window(window, segment_size).reshape(segment_size,1)
windata=data*scipy.signal.get_window(window, segment_size)
xbase=np.arange(0., segment_size,dtype=float)
index_out=0
invalids=0
......@@ -247,7 +248,7 @@ def spline_interpolate(data, rowwise=True, window=('tukey', 0.2) ):
for index_in in range(segment_num):
segment=np.ma.array(windata[index_in, :], mask=windata[index_in, :].mask) if rowwise else \
ma.array(windata[:,index_in], mask=windata[:,index_in].mask)
np.ma.array(windata[:,index_in], mask=windata[:,index_in].mask)
if segment.mask[0]:
segment[0]=0
segment.mask[0]=False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment