Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
raspberry-pi
sense-hat
Commits
89ddb3f6
Commit
89ddb3f6
authored
Apr 02, 2019
by
Rousseau Vincent
Browse files
Pretty legend
parent
e6e17d86
Changes
1
Hide whitespace changes
Inline
Side-by-side
read_csv.py
View file @
89ddb3f6
...
...
@@ -2,15 +2,16 @@ import csv
import
matplotlib.pyplot
as
plt
from
scipy
import
signal
import
numpy
as
np
from
datetime
import
datetime
with
open
(
'sense_hat_data_2019_0
1
_0
9_12
.csv'
)
as
f
:
with
open
(
'
data/
sense_hat_data_2019_0
3
_0
1_00
.csv'
)
as
f
:
datas
=
csv
.
reader
(
f
)
header
=
next
(
datas
)
temp
=
[]
time
=
[]
pressure
=
[]
for
row
in
datas
:
time
.
append
(
float
(
row
[
0
]))
time
.
append
(
datetime
.
fromtimestamp
(
float
(
row
[
0
]))
)
temp
.
append
(
float
(
row
[
2
]))
pressure
.
append
(
float
(
row
[
3
]))
...
...
@@ -27,10 +28,14 @@ pressure_filtered = signal.savgol_filter(pressure, 53, 3)
fig_temp
,
ax_temp
=
plt
.
subplots
()
ax_temp
.
plot
(
time
,
temp
)
ax_temp
.
plot
(
time
,
temp_filtered
)
ax_temp
.
set_title
(
'Température'
)
fig_temp
.
autofmt_xdate
()
fig_pres
,
ax_pres
=
plt
.
subplots
()
ax_pres
.
plot
(
time
,
pressure
)
ax_pres
.
plot
(
time
,
pressure_filtered
)
ax_pres
.
set_title
(
'Pression'
)
fig_pres
.
autofmt_xdate
()
plt
.
show
()
...
...
Write
Preview
Markdown
is supported
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