Venue 10 - two of our sensor units#

Venue 10 is running with two sensors for a while, and that puts all the readings in the same csv file. We’ve separated them - see our method in a separate section - and plot them here.

Separated data files:

# import ipywidgets as widgets
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go   

df1 = pd.read_csv("./venue-10/venue_10_sensor_1.csv")
df2 = pd.read_csv("./venue-10/venue_10_sensor_2.csv")
df1 = df1[(df1.temperature >-10)] # eliminate rogue data
df2 = df2[(df2.temperature >-10)] # eliminate rogue data


trace1 = go.Scatter(customdata=df1, 
                    y=df1['temperature'], 
                    x = df1['timestamp'], 
                    mode='lines', 
                    hoverinfo='all', 
                    name='sensor 1',
                    )

trace2 = go.Scatter(customdata=df2, 
                    y=df2['temperature'], 
                    x = df2['timestamp'], 
                    mode='lines', 
                    hoverinfo='all', 
                    name='sensor 2',
                    )

g = go.FigureWidget(data=[trace1,trace2],
                    layout = go.Layout(
                        yaxis=dict(range=[-3,25])
                    ))

fig = go.Figure(g)
fig.update_layout(showlegend=True, 
              autosize = True, 
              width=1000, 
              height=500,
)

fig.update_layout(
    hovermode='x unified',
   # range=[range_min, range_max],
    hoverlabel=dict(
        bgcolor="white",
        # font_size=16,
        font_family="Rockwell"
    )
)

#Add range slider
fig.update_layout(
    xaxis=dict(
        rangeselector=dict(
            buttons=list([
                dict(
                     label="All",
                     step="all"
                     ),
                                dict(count=1,
                     label="Hour",
                     step="hour",
                     stepmode="todate"),
                dict(count=1,
                     label="Day",
                     step="day",
                     stepmode="backward"),
                dict(count=7,
                     label="Week",
                     step="day",
                     stepmode="backward"),
                dict(count=1,
                     label="Year",
                     step="year",
                     stepmode="backward")
            ])
        ),
        rangeslider=dict(
            visible=True,
        ),
        type="date"
    )
)


#fig.add_hline(y=16, annotation_text='16C - usual minimum for children', annotation_font_color="blue", line_color='red', layer='above', line_dash='dash')
# fig.update_yaxes(range = [-5, dfCollatedDataSet['temperature'].max()+5])
fig.show()