Commit b238f15d authored by victor's avatar victor
Browse files

change ilc_shift()

parent 7eadc0c3
......@@ -112,21 +112,13 @@ def pad_data(a, b, val=0):
a[:,0] = b[:,0] # restore timestamp
return a, b
def ilc_shift(data, timestep, T):
out = []
for i, num in enumerate( data[:,0] ):
l = []
if i + timestep < len(data[:,0]):
l.append(num)
for n, val in enumerate(data[i+timestep,1:len(data[0])]):
l.insert(n+1,val)
#elif i + timestep >= len(data[:,0]):
# l.append( (i + timestep)*T )
# for n, val in enumerate(data[0,1:len(data[0])]):
# l.insert(n+1,0)
out.append(l)
out = np.array(out)
return out
data_out = data[timestep :,: ]
for i, val in enumerate (data_out):
data_out[i,0] = i*T
return data_out
def reshape(data, last_duration, new_duration):
......
Supports Markdown
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