To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit b7fb2211 authored by aweichbrodt's avatar aweichbrodt
Browse files

Initial commit.

parents
This diff is collapsed.
import pandas as pd
import plotly.express as px
from IPython.display import display
'''
Script applies to Feutron climate chamber
Depending on what kind of sensors are selected for data registration the number of columbs and their respective namming will varry.
Check available data columns.
File header looks as follows:
"Anlage";;"0";"0";"0";"0"
"Messstelle";;"1";"2";"3";"4"
"Kommentar";;"Temperatur";"R.H.";"Solltemperatur";"Sollfeuchte"
"Sensor";;"MV01";"MV11";"SV01";"SV11"
"Einheit";;"°C";"%";"°C";"%"
'''
filename = 'ANJO_RH80-T30_Week22.data'
def columns_available(filename):
'''Displays column names and some rows of data.'''
df = pd.read_csv(filename, skiprows=[0,1,3,4], sep=';', nrows=5)
display(df)
def plot_data(column_names):
'''Plots data of selected columns.'''
df = pd.read_csv(filename, skiprows=[0,1,3,4], sep=';')
datetime_column = df[df.columns[0]] + df[df.columns[1]]
df['datetime'] = pd.to_datetime(datetime_column, format='%d.%m.%Y %H:%M:%S' )
# For simplicity and convenience Plotly Express is used for plotting the data.
fig = px.line(df, x='datetime', y=column_names)
fig.show()
# The output is opened in a Webrowser and can be easily explored.
columns_available(filename)
# --> Define here the columns to be plotted <--
columns_to_plot = ['R.H.', 'Temperatur']
plot_data(columns_to_plot)
numpy==1.20.2
pandas==1.2.3
python-dateutil==2.8.1
pytz==2021.1
six==1.15.0
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