This example shows how easy it is to plot BayEOS Server series using the matplotlib package. The first step is to import all necessary python packages. In addition to our previous examples we need the matplotlib package and the appropriate magic to show the plot inline.
In [1]:
%matplotlib inline
import datetime as dt
import numpy as np
import bayeos.cli as bayeos
import matplotlib.pyplot as plt
Let's connect to our server and change our current folder to Alle Messungen/Micrometeorology Dept/AWS Ecological Botanical Garden/AWS EBG Data start May 08, 1997/Lufttemperatur & Feuchte
In [2]:
bayeos.connect('guest@bayeos')
bayeos.cd(36076)
Fetch the data of the current folder by calling the getSeries()
function.
In [3]:
data = bayeos.getSeries(aggfunc='avg',aggint='month',interval='this year')
Access the first column by it's name.
In [4]:
d = data['Lufttemperatur 02 m Höhe (HMP45)']
Create the dateTime values based on the transfered values.
In [5]:
i = [dt.datetime.fromtimestamp(t) for t in data['dateTime']]
Plot the data inline
In [6]:
plt.figure(figsize=[16,9])
plt.plot(i,d)
Out[6]:
In [7]:
bayeos.disconnect()
Out[7]:
In [7]: