Commit 30db0823 authored by Rousseau Vincent's avatar Rousseau Vincent
Browse files

Plot pressure

parent d2f801b4
......@@ -3,26 +3,35 @@ import matplotlib.pyplot as plt
from scipy import signal
import numpy as np
with open('sense_hat_data_2019_01_04_00_00.csv') as f:
with open('sense_hat_data_2019_01_09_12.csv') as f:
datas = csv.reader(f)
header = next(datas)
temp = []
time = []
pressure = []
for row in datas:
time.append(float(row[0]))
temp.append(float(row[2]))
pressure.append(float(row[3]))
print(temp)
#print(temp)
temp_decimate = signal.decimate(temp, 10, 3, zero_phase=True)
print(temp_decimate)
#print(temp_decimate)
temp_mean = np.mean(temp)
print(temp_mean)
temp_filtered = signal.savgol_filter(temp, 53, 3)
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)
fig_pres, ax_pres = plt.subplots()
ax_pres.plot(time, pressure)
ax_pres.plot(time, pressure_filtered)
plt.plot(time,temp)
plt.plot(time,temp_filtered)
plt.show()
Markdown is supported
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