Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lorenz Halt
ilc
Commits
c1d4509b
Commit
c1d4509b
authored
Mar 23, 2021
by
Lorenz Halt
🔀
Browse files
update data_visualizer
parent
38c8a99d
Changes
1
Show whitespace changes
Inline
Side-by-side
scripts/data_visualizer.ipynb
View file @
c1d4509b
...
...
@@ -53,9 +53,9 @@
"metadata": {},
"outputs": [],
"source": [
"#Pfade der Daten\n",
"#Pfade der Daten
(meas_path für measurement_logger Data / data_path für ilc_rosproxy Data)
\n",
"meas_path = local_path + \"/ilc_Meas\"\n",
"data_path = local_path + \"/test\"\n",
"data_path = local_path + \"/test\"
\n",
"\n",
"if os.path.exists(plot_path) == False:\n",
" os.makedirs(plot_path)"
...
...
%% 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: display_data
%% 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
```
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment