Skip to content

Commit 3f9f2f6

Browse files
committed
Import log with manual identification data properly
1 parent e01cef6 commit 3f9f2f6

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

autotune/data_extractor.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,19 @@ def extract_identification_data(log, t_u_data, u_data, t_y_data, y_data, axis):
9696
t_u = t_u_data[i_u]
9797
while t_y_data[i_y] <= t_u and i_y < len_y-1:
9898
i_y += 1
99-
while t_status[i_s] <= t_u and i_s < len_s-1:
100-
i_s += 1
10199

102-
status_aligned = status_data[i_s-1]
103-
if status_aligned == axis_to_state[axis]:
100+
if len_s > 0:
101+
while t_status[i_s] <= t_u and i_s < len_s-1:
102+
i_s += 1
103+
104+
status_aligned = status_data[i_s-1]
105+
106+
if status_aligned == axis_to_state[axis]:
107+
u_aligned.append(u_data[i_u])
108+
y_aligned.append(y_data[i_y-1])
109+
t_aligned.append(t_u)
110+
111+
else:
104112
u_aligned.append(u_data[i_u])
105113
y_aligned.append(y_data[i_y-1])
106114
t_aligned.append(t_u)

0 commit comments

Comments
 (0)