melodies_monet.plots.satplots

Functions

calc_default_colors(p_index)

List of default colors, lines, and markers to use if user does not specify them in the input yaml file.

calculate_boxplot(df[, df_reg, column, ...])

Combines data into acceptable format for box-plot

make_24hr_regulatory(df[, col])

Calculates 24-hour averages

make_8hr_regulatory(df[, col])

Calculates 8-hour rolling average daily

make_boxplot(comb_bx, label_bx[, ylabel, ...])

Creates box-plot.

make_spatial_bias_gridded(df[, column_o, ...])

Creates difference plot for satellite and model data.

make_spatial_overlay(df, vmodel[, column_o, ...])

Creates spatial overlay plot.

make_taylor(df[, df_reg, column_o, label_o, ...])

Creates taylor plot.

make_timeseries(df[, df_reg, column, label, ...])

Creates timeseries plot.

map_projection(f)

Defines map projection.

new_color_map()

Creates new color map for difference plots

melodies_monet.plots.satplots.calc_default_colors(p_index)

List of default colors, lines, and markers to use if user does not specify them in the input yaml file.

Parameters

p_index (integer) – Number of pairs in analysis class

Returns

list – List of dictionaries containing default colors, lines, and markers to use for plotting for the number of pairs in analysis class

melodies_monet.plots.satplots.calculate_boxplot(df, df_reg=None, column=None, label=None, plot_dict=None, comb_bx=None, label_bx=None)

Combines data into acceptable format for box-plot

Parameters
  • df (dataframe) – model/obs pair data to plot

  • df_reg (not currently enabled. empty argument for symmetry with surfplots) – model/obs paired regulatory data to plot

  • column (str) – Column label of variable to plot

  • label (str) – Name of variable to use in plot legend

  • comb_bx (dataframe) – dataframe containing information to create box-plot from previous occurrence so can overlay multiple model results on plot

  • label_bx (list) – list of string labels to use in box-plot from previous occurrence so can overlay multiple model results on plot

Returns

dataframe, list – dataframe containing information to create box-plot list of string labels to use in box-plot

melodies_monet.plots.satplots.make_24hr_regulatory(df, col=None)

Calculates 24-hour averages

Parameters
  • df (dataframe) – Model/obs pair of hourly data

  • col (str) – Column label of observation variable to apply the calculation

Returns

dataframe – dataframe with applied calculation

melodies_monet.plots.satplots.make_8hr_regulatory(df, col=None)

Calculates 8-hour rolling average daily

Parameters
  • df (dataframe) – Model/obs pair of hourly data

  • col (str) – Column label of observation variable to apply the calculation

Returns

dataframe – dataframe with applied calculation

melodies_monet.plots.satplots.make_boxplot(comb_bx, label_bx, ylabel=None, vmin=None, vmax=None, outname='plot', domain_type=None, domain_name=None, plot_dict=None, fig_dict=None, text_dict=None, debug=False)

Creates box-plot.

Parameters
  • comb_bx (dataframe) – dataframe containing information to create box-plot from calculate_boxplot

  • label_bx (list) – list of string labels to use in box-plot from calculate_boxplot

  • ylabel (str) – Title of y-axis

  • vmin (real number) – Min value to use on y-axis

  • vmax (real number) – Max value to use on y-axis

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

  • domain_type (str) – Domain type specified in input yaml file

  • domain_name (str) – Domain name specified in input yaml file

  • plot_dict (dictionary) – Dictionary containing information about plotting for each pair (e.g., color, linestyle, markerstyle)

  • fig_dict (dictionary) – Dictionary containing information about figure

  • text_dict (dictionary) – Dictionary containing information about text

  • debug (boolean) – Whether to plot interactively (True) or not (False). Flag for submitting jobs to supercomputer turn off interactive mode.

Returns

plot – box plot

melodies_monet.plots.satplots.make_spatial_bias_gridded(df, column_o=None, label_o=None, column_m=None, label_m=None, ylabel=None, vmin=None, vmax=None, nlevels=None, proj=None, outname='plot', domain_type=None, domain_name=None, fig_dict=None, text_dict=None, debug=False)

Creates difference plot for satellite and model data. For data in swath format, overplots all differences For data on regular grid, mean difference.

melodies_monet.plots.satplots.make_spatial_overlay(df, vmodel, column_o=None, label_o=None, column_m=None, label_m=None, ylabel=None, vmin=None, vmax=None, nlevels=None, proj=None, outname='plot', domain_type=None, domain_name=None, fig_dict=None, text_dict=None, debug=False)

Creates spatial overlay plot.

Parameters
  • df (dataframe) – model/obs pair data to plot

  • vmodel (dataarray) – slice of model data to plot

  • column_o (str) – Column label of observation variable to plot

  • label_o (str) – Name of observation variable to use in plot title

  • column_m (str) – Column label of model variable to plot

  • label_m (str) – Name of model variable to use in plot title

  • ylabel (str) – Title of colorbar axis

  • vmin (real number) – Min value to use on colorbar axis

  • vmax (real number) – Max value to use on colorbar axis

  • nlevels (integer) – Number of levels used in colorbar axis

  • proj (cartopy projection) – cartopy projection to use in plot

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

  • domain_type (str) – Domain type specified in input yaml file

  • domain_name (str) – Domain name specified in input yaml file

  • fig_dict (dictionary) – Dictionary containing information about figure

  • text_dict (dictionary) – Dictionary containing information about text

  • debug (boolean) – Whether to plot interactively (True) or not (False). Flag for submitting jobs to supercomputer turn off interactive mode.

Returns

plot – spatial overlay plot

melodies_monet.plots.satplots.make_taylor(df, df_reg=None, column_o=None, label_o='Obs', column_m=None, label_m='Model', dia=None, ylabel=None, ty_scale=1.5, domain_type=None, domain_name=None, plot_dict=None, fig_dict=None, text_dict=None, debug=False)

Creates taylor plot. Note sometimes model values are off the scale on this plot. This will be fixed soon.

Parameters
  • df (dataframe) – model/obs pair data to plot

  • df_reg (not currently enabled. empty argument for symmetry with surfplots) – model/obs paired regulatory data to plot

  • column_o (str) – Column label of observational variable to plot

  • label_o (str) – Name of observational variable to use in plot legend

  • column_m (str) – Column label of model variable to plot

  • label_m (str) – Name of model variable to use in plot legend

  • dia (dia) – matplotlib ax from previous occurrence so can overlay obs and model results on the same plot

  • ylabel (str) – Title of x-axis

  • ty_scale (real) – Scale to apply to taylor plot to control the plotting range

  • domain_type (str) – Domain type specified in input yaml file

  • domain_name (str) – Domain name specified in input yaml file

  • plot_dict (dictionary) – Dictionary containing information about plotting for each pair (e.g., color, linestyle, markerstyle)

  • fig_dict (dictionary) – Dictionary containing information about figure

  • text_dict (dictionary) – Dictionary containing information about text

  • debug (boolean) – Whether to plot interactively (True) or not (False). Flag for submitting jobs to supercomputer turn off interactive mode.

Returns

class – Taylor diagram class defined in MONET

melodies_monet.plots.satplots.make_timeseries(df, df_reg=None, column=None, label=None, ax=None, avg_window=None, ylabel=None, vmin=None, vmax=None, domain_type=None, domain_name=None, plot_dict=None, fig_dict=None, text_dict=None, debug=False)

Creates timeseries plot.

Parameters
  • df (dataframe) – model/obs pair data to plot

  • column (str) – Column label of variable to plot

  • df_reg (not currently enabled. empty argument for symmetry with surfplots) – model/obs paired regulatory data to plot

  • label (str) – Name of variable to use in plot legend

  • ax (ax) – matplotlib ax from previous occurrence so can overlay obs and model results on the same plot

  • avg_window (rule) – Pandas resampling rule (e.g., ‘H’, ‘D’)

  • ylabel (str) – Title of y-axis

  • vmin (real number) – Min value to use on y-axis

  • vmax (real number) – Max value to use on y-axis

  • domain_type (str) – Domain type specified in input yaml file

  • domain_name (str) – Domain name specified in input yaml file

  • plot_dict (dictionary) – Dictionary containing information about plotting for each pair (e.g., color, linestyle, markerstyle)

  • fig_dict (dictionary) – Dictionary containing information about figure

  • text_dict (dictionary) – Dictionary containing information about text

  • debug (boolean) – Whether to plot interactively (True) or not (False). Flag for submitting jobs to supercomputer turn off interactive mode.

Returns

ax – matplotlib ax such that driver.py can iterate to overlay multiple models on the same plot

melodies_monet.plots.satplots.map_projection(f)

Defines map projection. This needs updating to make it more generic.

Parameters

f (class) – model class

Returns

cartopy projection – projection to be used by cartopy in plotting

melodies_monet.plots.satplots.new_color_map()

Creates new color map for difference plots

Returns

colormap – Orange and blue color map