metobs_toolkit.analysis.Analysis.get_diurnal_statistics#
- Analysis.get_diurnal_statistics(colorby='name', obstype='temp', stations=None, startdt=None, enddt=None, plot=True, title=None, y_label=None, legend=True, errorbands=False, _return_all_stats=False)[source]#
Create an average diurnal cycle for the observations.
(In the plot, each station is represed by a line.)
- Parameters:
colorby ('name' or 'lcz', optional) – If ‘name’ the plotted lines will be colored per station, if ‘lcz’ the colors represent the stations lcz. The default is ‘name’.
obstype (str, optional) – Element of the metobs_toolkit.observation_types The default is ‘temp’.
stations (list, optional) – List of station names to use. If None, all present stations will be used. The default is None.
startdt (datetime.datetime, optional) – The start datetime of the observations to use. If None, all timestamps will be used. The default is None.
enddt (datetime.datetime, optional) – The end datetime of the observations to use. If None, all timestamps will be used. The default is None.
plot (bool, optional) – If True, an diurnal plot is made. The default is True.
title (string, optional) – Title of the figure, if None a default title is generated. The default is None.
y_label (string, optional) – y-axes label of the figure, if None a default label is generated. The default is None.
legend (bool, optional) – I True, a legend is added to the plot. The default is True.
errorbands (bool, optional) – If True, the std is representd in the plot by colored bands. The default is False.
- Returns:
df – The dataframe containing the aggregated values.
- Return type:
pandas.DataFrame()
Note
If a timezone unaware datetime is given as an argument, it is interpreted as if it has the same timezone as the observations.