plotting.cam_taylor_diagram module

Module: cam_taylor_diagram

Provides a Taylor diagram following the AMWG package. Uses spatial information only.

This module, for better or worse, provides both the computation and plotting functionality. It depends on an ADF instance to obtain the climo files. It is designed to have one “reference” case (could be observations) and arbitrary test cases. When multiple test cases are provided, they are plotted with different colors.

scripts.plotting.cam_taylor_diagram.cam_taylor_diagram(adfobj)[source]

Make a Taylor Diagram, eh?

scripts.plotting.cam_taylor_diagram.get_eqpactaux(adf, casename, location)[source]

Gets zonal surface wind stress 5S to 5N.

scripts.plotting.cam_taylor_diagram.get_landt2m(adf, casename, location)[source]

Gets TREFHT (T_2m) and removes non-land points.

scripts.plotting.cam_taylor_diagram.get_var_at_plev(adf, casename, location, variable, plev)[source]

Get variable from the data and then interpolate it to isobaric level plev (units of hPa).

scripts.plotting.cam_taylor_diagram.get_vertical_average(adf, casename, location, varname)[source]

Collect data from case and use vertical_average to get result.

scripts.plotting.cam_taylor_diagram.get_virh(adf, casename, location, **kwargs)[source]

Calculate vertically averaged relative humidity.

scripts.plotting.cam_taylor_diagram.get_vit(adf, casename, location, **kwargs)[source]

Calculate vertically averaged temperature.

scripts.plotting.cam_taylor_diagram.plot_taylor_data(wks, df, **kwargs)[source]

Apply data on top of the Taylor Diagram Axes. wks -> Axes object, probably from taylor_plot_setup df -> DataFrame holding the Taylor stats. kwargs -> optional arguments

look for ‘use_bias’ look for ‘case_color’

scripts.plotting.cam_taylor_diagram.taylor_plot_finalize(wks, test_nicknames, casecolors, syear_cases, eyear_cases, needs_bias_labels=True)[source]

Apply final formatting to a Taylor diagram. wks -> Axes object that has passed through taylor_plot_setup and plot_taylor_data casenames -> list of case names for the legend casecolors -> list of colors for the cases needs_bias_labels -> Bool, if T make the legend for the bias-sized markers.

scripts.plotting.cam_taylor_diagram.taylor_plot_setup(title, baseline)[source]

Constructs Figure and Axes objects for basic Taylor Diagram.

scripts.plotting.cam_taylor_diagram.taylor_stats_single(casedata, refdata, w=True)[source]

This replicates the basic functionality of ‘taylor_stats’ from NCL. input:

casedata : input data, DataArray refdata : reference case data, DataArray w : if true use cos(latitude) as spatial weight, if false assume uniform weight

Returns:

pattern_correlation, ratio of standard deviation (case/ref), bias

scripts.plotting.cam_taylor_diagram.vertical_average(fld, ps, acoef, bcoef)[source]

Calculate weighted vertical average using trapezoidal rule. Uses full column.

scripts.plotting.cam_taylor_diagram.weighted_std(x, weights)[source]

Weighted standard deviation. x -> xr.DataArray weights -> array-like of weights, probably xr.DataArray If weights is not the same shape as x, will use broadcast_like to create weights array. Returns the weighted standard deviation of the full x array.