melodies_monet.plots.satplots
Functions
|
List of default colors, lines, and markers to use if user does not specify them in the input yaml file. |
|
Combines data into acceptable format for box-plot |
|
Calculates 24-hour averages |
|
Calculates 8-hour rolling average daily |
|
Creates box-plot. |
|
Creates difference plot for satellite and model data. |
|
Creates spatial overlay plot. |
|
Creates taylor plot. |
|
Creates timeseries plot. |
Defines map projection. |
|
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 plotdf_reg (
not currently enabled. empty argument for symmetry with surfplots
) – model/obs paired regulatory data to plotcolumn (
str
) – Column label of variable to plotlabel (
str
) – Name of variable to use in plot legendcomb_bx (
dataframe
) – dataframe containing information to create box-plot from previous occurrence so can overlay multiple model results on plotlabel_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 datacol (
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 datacol (
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_boxplotlabel_bx (
list
) – list of string labels to use in box-plot from calculate_boxplotylabel (
str
) – Title of y-axisvmin (
real number
) – Min value to use on y-axisvmax (
real number
) – Max value to use on y-axisoutname (
str
) – file location and name of plot (do not include .png)domain_type (
str
) – Domain type specified in input yaml filedomain_name (
str
) – Domain name specified in input yaml fileplot_dict (
dictionary
) – Dictionary containing information about plotting for each pair (e.g., color, linestyle, markerstyle)fig_dict (
dictionary
) – Dictionary containing information about figuretext_dict (
dictionary
) – Dictionary containing information about textdebug (
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 plotvmodel (
dataarray
) – slice of model data to plotcolumn_o (
str
) – Column label of observation variable to plotlabel_o (
str
) – Name of observation variable to use in plot titlecolumn_m (
str
) – Column label of model variable to plotlabel_m (
str
) – Name of model variable to use in plot titleylabel (
str
) – Title of colorbar axisvmin (
real number
) – Min value to use on colorbar axisvmax (
real number
) – Max value to use on colorbar axisnlevels (
integer
) – Number of levels used in colorbar axisproj (
cartopy projection
) – cartopy projection to use in plotoutname (
str
) – file location and name of plot (do not include .png)domain_type (
str
) – Domain type specified in input yaml filedomain_name (
str
) – Domain name specified in input yaml filefig_dict (
dictionary
) – Dictionary containing information about figuretext_dict (
dictionary
) – Dictionary containing information about textdebug (
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 plotdf_reg (
not currently enabled. empty argument for symmetry with surfplots
) – model/obs paired regulatory data to plotcolumn_o (
str
) – Column label of observational variable to plotlabel_o (
str
) – Name of observational variable to use in plot legendcolumn_m (
str
) – Column label of model variable to plotlabel_m (
str
) – Name of model variable to use in plot legenddia (
dia
) – matplotlib ax from previous occurrence so can overlay obs and model results on the same plotylabel (
str
) – Title of x-axisty_scale (
real
) – Scale to apply to taylor plot to control the plotting rangedomain_type (
str
) – Domain type specified in input yaml filedomain_name (
str
) – Domain name specified in input yaml fileplot_dict (
dictionary
) – Dictionary containing information about plotting for each pair (e.g., color, linestyle, markerstyle)fig_dict (
dictionary
) – Dictionary containing information about figuretext_dict (
dictionary
) – Dictionary containing information about textdebug (
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 plotcolumn (
str
) – Column label of variable to plotdf_reg (
not currently enabled. empty argument for symmetry with surfplots
) – model/obs paired regulatory data to plotlabel (
str
) – Name of variable to use in plot legendax (
ax
) – matplotlib ax from previous occurrence so can overlay obs and model results on the same plotavg_window (
rule
) – Pandas resampling rule (e.g., ‘H’, ‘D’)ylabel (
str
) – Title of y-axisvmin (
real number
) – Min value to use on y-axisvmax (
real number
) – Max value to use on y-axisdomain_type (
str
) – Domain type specified in input yaml filedomain_name (
str
) – Domain name specified in input yaml fileplot_dict (
dictionary
) – Dictionary containing information about plotting for each pair (e.g., color, linestyle, markerstyle)fig_dict (
dictionary
) – Dictionary containing information about figuretext_dict (
dictionary
) – Dictionary containing information about textdebug (
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