Skip to content
Snippets Groups Projects
Commit e0f0d826 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[plots] Add plot_utils.load_log_txt

parent b409cd7c
No related branches found
No related tags found
No related merge requests found
......@@ -66,4 +66,20 @@ def plot_sot_sig(filename,idxs):
filename = '/tmp/dg_'+filename+'.dat'
data, name = read_tracer_file(filename)
plot_select_traj(data,idxs,name)
return
return
def load_log_txt(filename):
v = np.loadtxt(filename)
t = v[:,0]
v = v[:,2:]
idx = 0
for i in range(1,len(t)):
if t[i]<t[i-1]:
idx = i
break
if idx>0:
t = np.concatenate( (t[idx:], t[:idx]) )
v = np.concatenate( (v[idx:,:], v[:idx,:]), axis=0 )
return t, v
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment