scripts.plotting.cam_taylor_diagram
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.
Functions
|
|
|
Make a Taylor Diagram, eh? |
|
Calculate weighted vertical average using trapezoidal rule. Uses full column. |
|
|
|
|
|
|
|
|
|
|
|
Get variable from the data and then interpolate it to isobaric level plev (units of hPa). |
|
|
|
Collect data from case and use vertical_average to get result. |
|
Calculate vertically averaged relative humidity. |
|
Calculate vertically averaged temperature. |
|
Gets TREFHT (T_2m) and removes non-land points. |
|
Gets zonal surface wind stress 5S to 5N. |
|
|
|
Custom function that retrieves a variable. Returns the variable as a DataArray. |
|
|
|
Weighted standard deviation. |
|
This replicates the basic functionality of 'taylor_stats' from NCL. |
|
Constructs Figure and Axes objects for basic Taylor Diagram. |
|
Apply data on top of the Taylor Diagram Axes. |
|
Apply final formatting to a Taylor diagram. |
Module Contents
- 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.get_tropical_land_precip(adf, casename, location, **kwargs)[source]
- scripts.plotting.cam_taylor_diagram.get_tropical_ocean_precip(adf, casename, location, **kwargs)[source]
- 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.get_landt2m(adf, casename, location)[source]
Gets TREFHT (T_2m) and removes non-land points.
- scripts.plotting.cam_taylor_diagram.get_eqpactaux(adf, casename, location)[source]
Gets zonal surface wind stress 5S to 5N.
- scripts.plotting.cam_taylor_diagram._retrieve(adfobj, variable, casename, location, return_dataset=False)[source]
Custom function that retrieves a variable. Returns the variable as a DataArray. kwarg: return_dataset -> if true, return the dataset object, otherwise return the DataArray
with variable This option allows get_u_at_plev to use _retrieve.
- 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.
- 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.taylor_plot_setup(title, baseline)[source]
Constructs Figure and Axes objects for basic Taylor Diagram.
- 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.