Commit c1d4509b authored by Lorenz Halt's avatar Lorenz Halt 🔀
Browse files

update data_visualizer

parent 38c8a99d
%% Cell type:code id: tags:
``` python
import matplotlib.pyplot as plt
import numpy as np
import os
```
%% Cell type:code id: tags:
``` python
local_path = "/home/ipa325/Documents"
```
%% Cell type:code id: tags:
``` python
def read(file):
with open(file, 'r') as f:
header_str = f.readline().strip()
data = np.genfromtxt(file,
delimiter=',',
autostrip=True,
skip_header=1)
return data, header_str
```
%% Cell type:code id: tags:
``` python
def error_convergence(data):
y = np.linalg.norm(data[:,1:], ord=2, axis=0)
return y
```
%% Cell type:code id: tags:
``` python
#Pfade der Daten
#Pfade der Daten (meas_path für measurement_logger Data / data_path für ilc_rosproxy Data)
meas_path = local_path + "/ilc_Meas"
data_path = local_path + "/test"
if os.path.exists(plot_path) == False:
os.makedirs(plot_path)
```
%% Cell type:code id: tags:
``` python
#hacky plots für den Measurement_logger
plt.figure()
num=-1
for n in range(0,100):
for i in range(0,100):
for j in range(0,100):
try:
if n<10:
if i <10:
if j<10:
err,h = read(meas_path + "/force_meas_2021-03-22_0{}_0{}_0{}.csv".format(n,i,j))
else:
err,h = read(meas_path + "/force_meas_2021-03-22_0{}_0{}_{}.csv".format(n,i,j))
else:
if j<10:
err,h = read(meas_path + "/force_meas_2021-03-22_0{}_{}_0{}.csv".format(n,i,j))
else:
err,h = read(meas_path + "/force_meas_2021-03-22_0{}_{}_{}.csv".format(n,i,j))
else:
if i<10:
if j<10:
err,h = read(meas_path + "/force_meas_2021-03-22_{}_0{}_0{}.csv".format(n,i,j))
else:
err,h = read(meas_path + "/force_meas_2021-03-22_{}_0{}_{}.csv".format(n,i,j))
else:
if j<10:
err,h = read(meas_path + "/force_meas_2021-03-22_{}_{}_0{}.csv".format(n,i,j))
else:
err,h = read(meas_path + "/force_meas_2021-03-22_{}_{}_{}.csv".format(n,i,j))
num=num+1
plt.plot(err.T[0],-1*err.T[6], label = num)
except:
pass
#plt.legend()
plt.show()
```
%% Output
%% Cell type:code id: tags:
``` python
#plots für daten in data_path (von ilc_rosproxy geschrieben)
plt.figure()
convergence = []
for i in range(0,100):
try:
err,h = read(data_path + "/read_error/read_error_{}.csv".format(i))
convergence.append( np.max( error_convergence(err) ) )
plt.plot(err.T[0],err.T[1])
except:
pass
plt.show()
print(convergence)
plt.figure()
plt.plot(convergence)
plt.show
```
......
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