melodies_monet.stats.proc_stats
Functions
|
Calculate statistics |
|
Calculates all of the specified statistics, save to csv file, and optionally save to a figure visualizing the table. |
|
Select statistics. |
- melodies_monet.stats.proc_stats.calc(df, stat=None, obsvar=None, modvar=None, wind=False)
Calculate statistics
- Parameters
df (
dataframe
) – model/obs pair dataobsvar (
str
) – Column label of observation variablemodvar (
str
) – Column label of model variablewind (
boolean
) – If variable is wind MONET applies a special calculation to handle negative and positive values. If wind (True) if not wind (False).
- Returns
real
– statistical value
- melodies_monet.stats.proc_stats.create_table(df, outname='plot', title='stats', out_table_kwargs=None, debug=False)
Calculates all of the specified statistics, save to csv file, and optionally save to a figure visualizing the table.
- Parameters
df (
dataframe
) – model/obs pair dataoutname (
str
) – file location and name of plot (do not include .png)title (
str
) – Title to include on the figure visualizing the tableout_table_kwargs (
dictionary
) – Dictionary containing information to create the figure visualizing the table.debug (
boolean
) – Whether to plot interactively (True) or not (False). Flag for submitting jobs to supercomputer turn off interactive mode.
- Returns
csv file
,plot
– csv file and optional plot containing the statistical calculations specified in the input yaml file.
- melodies_monet.stats.proc_stats.produce_stat_dict(stat_list, spaces=False)
Select statistics. Only statistics listed in the default dictionary below are available.
- Parameters
stat_list (
list
ofstrings
) – List of statistic abbreviations specified in input yaml filespaces (
boolean
) – Whether to leave spaces in the string containing the full name (True) or remove spaces (False).
- Returns
dictionary
– dictionary of statistics including abbreviations and full name