You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: WormView.py
+19-6Lines changed: 19 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -127,12 +127,22 @@ def main():
127
127
128
128
ax.set_ylim([-1.5, 1.5])
129
129
130
-
t=np.array(wcon["data"][0]["t"])
130
+
t_units=""
131
+
x_units=""
132
+
y_units=""
133
+
134
+
if"units"inwcon:
135
+
t_units=wcon["units"].get("t")
136
+
x_units=wcon["units"].get("x")
137
+
y_units=wcon["units"].get("y")
138
+
print(f"Time units: {t_units}, x units: {x_units}, y units: {y_units}")
139
+
140
+
times=np.array(wcon["data"][0]["t"])
131
141
x=np.array(wcon["data"][0]["x"]).T
132
142
y=np.array(wcon["data"][0]["y"]).T
133
143
134
144
print(
135
-
f"Range of time: {t[0]}->{t[0]}; x range: {x.max()}->{x.min()}; y range: {y.max()}->{y.min()}"
145
+
f"Range of time: {times[0]}{t_units}->{times[-1]}{t_units}; x range: {x.max()}{x_units}->{x.min()}{x_units}; y range: {y.max()}{y_units}->{y.min()}{y_units}"
# TODO WormViewCSV and WormViewWCON - should WormViewCSV just be the original WormView? That's what it initially did.
195
208
# TODO Could take out Player and WormViewWCON into separate repo - Taking out Player could be ugly. It is quite coupled with WormView due to the update function.
0 commit comments