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