melodies_monet.stats.proc_stats

Functions

calc(df[, stat, obsvar, modvar, wind])

Calculate statistics

create_table(df[, outname, title, ...])

Calculates all of the specified statistics, save to csv file, and optionally save to a figure visualizing the table.

produce_stat_dict(stat_list[, spaces])

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 data

  • obsvar (str) – Column label of observation variable

  • modvar (str) – Column label of model variable

  • wind (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 data

  • outname (str) – file location and name of plot (do not include .png)

  • title (str) – Title to include on the figure visualizing the table

  • out_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 of strings) – List of statistic abbreviations specified in input yaml file

  • spaces (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