../_images/calypso.png

toto.plugins.plots.plot_roses

class toto.plugins.plots.plot_roses.StatPlots(pandas_obj)[source]

Bases: object

BIAS_histogramm(measured='measured', modelled='modelled', args={'Nb of bins': 30, 'Xlabel': '', 'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'units': ''})[source]

This function provides a bias histogramm between measured and predicted data for any variables

Parameters

measuredstr

Name of the column to contain the measured data.

modelledstr

Name of the column to contain the modelled data.

args: dict

Dictionnary with the folowing keys: Nb of bins: int

Number of bins to use

Xlabel: str

X axis label

Units: str

Units of the data

display: str

On or Off to display image

folder out: str

Path to save the output

Examples:

>>> df=tf['test1']['dataframe'].StatPlots.BIAS_histogramm(measured='U',modelled='U_m')
>>> 
QQ_plot(measured='measured', modelled='modelled', args={'Quantile increment step (%)': 1.0, 'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'measured name': '', 'measured unit': '', 'modelled name': '', 'modelled unit': ''})[source]

This function provides Quantile-Quantile plots (Q-Q plots) for comparison statistics.

Parameters

measuredstr

Name of the column to contain the measured data.

modelledstr

Name of the column to contain the modelled data.

args: dict

Dictionnary with the folowing keys: measured name: str

Name of the Y axis

modelled name: str

Name of the X axis

measured unit: str

Unit of the Y axis

modelled unit: str

Unit of the X axis

Quantile increment step (%): float

Quantile increment step in percentage

display: str

On or Off to display image

folder out: str

Path to save the output

Examples:

>>> df=tf['test1']['dataframe'].StatPlots.QQ_plot(measured='U',modelled='U_m')
>>> 
density_diagramm(X='X', Y='Y', args={'X limits': [0, inf], 'X name': '', 'X unit': '', 'Y limits': [0, inf], 'Y name': '', 'Y unit': '', 'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'minimum': 0.001})[source]

This function provides density diagrams of parameter Y vs parameter X, i.e. similar to scatter plot but emphasing on region withg large number of data

Xstr

Name of the column to plot on the X axis.

Ystr

Name of the column to plot on the Y axis.

args: dict

Dictionnary with the folowing keys: Y name: str

Name of the Y axis

X name: str

Name of the X axis

Y unit: str

Unit of the Y axis

X unit: str

Unit of the X axis

Y limits: list

2 value list with Y axis limit

X limits: list

2 value list with X axis limits

display: str

On or Off to display image

folder out: str

Path to save the output

minimum: float

Minimum value to plot

>>> df=tf['test1']['dataframe'].StatPlots.density_diagramm(X='U',Y='U_m')
>>> 
joint_probability_plot(X='X', Y='Y', args={'X Min Res Max(optional)': [2, 1, 22], 'X label': '', 'Y Min Res Max(optional)': [0, 0.5], 'Y label': '', 'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'probablity expressed in': {'per thoushand': True, 'percent': False}, 'time blocking': {'Annual': True, 'Monthly': False, 'Seasonal (North hemisphere)': False, 'Seasonal (South hemisphere)': False}})[source]

This function provides joint distribution graph for X and Y, i.e. the probability of events defined in terms of both X and Y (per 1000)

Parameters

Xstr

Name of the column to plot on the X axis.

Ystr

Name of the column to plot on the Y axis.

args: dict

Dictionnary with the folowing keys: X Min Res Max(optional): list

Minimum, resolution and maximum value of X axis use in the join probability

Y Min Res Max(optional): list

Minimum, resolution and maximum value of Y axis use in the join probability

X label: str

Label for the X axis

Y label: str

Label for the Y axis

display: str

On or Off to display image

folder out: str

Path to save the output

probablity expressed in:

Can be percent or per thoushand

time blocking: str
if Time blocking=='Annual',

Statistics will be calculated for the whole timeserie

if Time blocking=='Seasonal (South hemisphere)',

Statistics will be calculated for South hemisphere seasons

if Time blocking=='Seasonal (North hemisphere)',

Statistics will be calculated for North hemisphere seasons

if Time blocking=='Monthly',

Statistics will be calculated for each month.

Examples:

>>> df=tf['test1']['dataframe'].StatPlots.plot_thermocline(mag=['U_lev_1','U_lev_2'],args={'function':'Mean',time blocking':'Yearly'})
>>> 
percentage_of_occurence(mag='mag', drr='drr', args={'X label': 'Wind speed in [m/s]', 'direction binning': {'centered': True, 'not-centered': False}, 'direction interval': 45.0, 'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'magnitude interval (optional)': [], 'time blocking': {'Annual': True, 'Monthly': False, 'Seasonal (North hemisphere)': False, 'Seasonal (South hemisphere)': False}})[source]

This function provides percentage of occurnce from any variable. plot are directional if direction is supplied

Parameters

magstr

Name of the column from which to get stats.

drrstr

Column name representing the directions.

args: dict

Dictionnary with the folowing keys: title: str

Graph title

magnitude interval (optional): list

interval to use for the magnitude

X label: str

Label for the X axis

direction binning: str

Can be centered or not-centered depending if the directionnal are centered over 0

direction interval: int

Dirctionnal interval for the bins in degrees

display: str

On or Off to display image

folder out: str

Path to save the output

time blocking: str
if Time blocking=='Annual',

Statistics will be calculated for the whole timeserie

if Time blocking=='Seasonal (South hemisphere)',

Statistics will be calculated for South hemisphere seasons

if Time blocking=='Seasonal (North hemisphere)',

Statistics will be calculated for North hemisphere seasons

if Time blocking=='Monthly',

Statistics will be calculated for each month.

Examples:

>>> df=tf['test1']['dataframe'].StatPlots.Percentage_of_occurence(mag='U',drr='drr',args={'time blocking':'Yearly'})
>>> 
plot_roses(mag='mag', drr='drr', args={'% quadran (optional)': [], 'display': True, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'speed bins (optional)': [], 'time blocking': {'Annual': True, 'Monthly': False, 'Seasonal (North hemisphere)': False, 'Seasonal (South hemisphere)': False}, 'title': 'Current speed', 'units': 'm/s'})[source]

This function provides annual, seasonal or monthly rose plots for wind, wave, current or any direcional variable. This function is using https://github.com/python-windrose/windrose

Parameters

magstr

Name of the column from which to get stats.

drrstr

Column name representing the directions.

args: dict

Dictionnary with the folowing keys: title: str

Graph title

speed bins (optional): list

Speed to plot

% quadran (optional): list

Percentage of each occurence to plot

display: str

On or Off to display image

folder out: str

Path to save the output

time blocking: str
if Time blocking=='Annual',

Statistics will be calculated for the whole timeserie

if Time blocking=='Seasonal (South hemisphere)',

Statistics will be calculated for South hemisphere seasons

if Time blocking=='Seasonal (North hemisphere)',

Statistics will be calculated for North hemisphere seasons

if Time blocking=='Monthly',

Statistics will be calculated for each month.

Examples:

>>> df=tf['test1']['dataframe'].StatPlots.plot_roses(mag='U',drr='drr',args={'time blocking':'Yearly'})
>>> 
plot_thermocline(mag=['mag'], args={'X label': 'Water temperature [degC]', 'display': {'Off': False, 'On': True}, 'folder out': '/home/docs/checkouts/readthedocs.org/user_builds/totodoc/checkouts/latest/docs', 'function': {'Max': True, 'Mean': False, 'Median': False, 'Min': False, 'Percentile': False, 'Prod': False, 'Quantile': False, 'Std': False, 'Sum': False, 'Var': False}, 'percentile or Quantile': 0.1, 'table': {'Off': False, 'On': True}, 'time blocking': {'Annual': True, 'Monthly': False, 'Seasonal (North hemisphere)': False, 'Seasonal (South hemisphere)': False}})[source]

This function provides a plot of parameter versus water depth. This function average the timeseries ( by mean, median …)

Notes

Variables MUST be in the format *_lev_1,*_lev_2 etc..

Parameters

maglist

Name of the column from which to get stats.

args: dict

Dictionnary with the folowing keys: function: str

Statistics to use to process each level: can be Max,`Mean`,`Median`,`Min`,`Percentile`,`Prod`,`Quantile`,`Std`,`Sum` or Var

‘percentile or Quantile’: float

Percetile or quantile to use

X label: str

Label for the X axis

display: str

On or Off to display image

table: str

On or Off to print result in a table

folder out: str

Path to save the output

time blocking: str
if Time blocking=='Annual',

Statistics will be calculated for the whole timeserie

if Time blocking=='Seasonal (South hemisphere)',

Statistics will be calculated for South hemisphere seasons

if Time blocking=='Seasonal (North hemisphere)',

Statistics will be calculated for North hemisphere seasons

if Time blocking=='Monthly',

Statistics will be calculated for each month.

Examples:

>>> df=tf['test1']['dataframe'].StatPlots.plot_thermocline(mag=['U_lev_1','U_lev_2'],args={'function':'Mean',time blocking':'Yearly'})
>>>