gcpy.plot.compare_single_level
- gcpy.plot.compare_single_level(refdata, refstr, devdata, devstr, varlist=None, ilev=0, itime=0, refmet=None, devmet=None, weightsdir='.', pdfname='', cmpres=None, match_cbar=True, normalize_by_area=False, enforce_units=True, convert_to_ugm3=False, flip_ref=False, flip_dev=False, use_cmap_RdBu=False, verbose=False, log_color_scale=False, extra_title_txt=None, extent=None, n_job=-1, sigdiff_list=None, second_ref=None, second_dev=None, spcdb_files=None, ll_plot_func='imshow', **extra_plot_args)[source]
Create single-level 3x2 comparison map plots for variables common in two xarray Datasets. Optionally save to PDF.
- Parameters:
refdata (
xarray.Dataset) – Dataset used as reference in comparison.refstr (
str) – String description for reference data to be used in plots.devdata (
xarray.Dataset) – Dataset used as development in comparison.devstr (
str) – String description for development data to be used in plots.varlist (
listofstr, optional) – List of xarray dataset variable names to make plots for. Default value: None (will compare all common variables)ilev (
int, optional) – Dataset level dimension index using 0-based system. Indexing is ambiguous when plotting differing vertical grids. Default value: 0itime (
int, optional) – Dataset time dimension index using 0-based system. Default value: 0refmet (
xarray.Dataset, optional) – Dataset containing ref meteorology. Default value: Nonedevmet (
xarray.Dataset, optional) – Dataset containing dev meteorology. Default value: Noneweightsdir (
str, optional) – Directory path for storing regridding weights. Default value: None (will create/store weights in current directory)pdfname (
str, optional) – File path to save plots as PDF. Default value: Empty string (will not create PDF)cmpres (
str, optional) – String description of grid resolution at which to compare datasets. Default value: None (will compare at highest resolution of ref and dev)match_cbar (
bool, optional) – Set this flag to True if you wish to use the same colorbar bounds for the Ref and Dev plots. Default value: Truenormalize_by_area (
bool, optional) – Set this flag to True if you wish to normalize the Ref and Dev raw data by grid area. Input ref and dev datasets must include AREA variable in m2 if normalizing by area. Default value: Falseenforce_units (
bool, optional) – Set this flag to True to force an error if Ref and Dev variables have different units. Default value: Trueconvert_to_ugm3 (
bool, optional) – Whether to convert data units to ug/m3 for plotting. Default value: Falsespcdb_files (
strorlist, optional) – A single species_database.yml file or a list of files (e.g. for Ref & Dev). Only used when convert_ugm3=True. Default value: Noneflip_ref (
bool, optional) – Set this flag to True to flip the vertical dimension of 3D variables in the Ref dataset. Default value: Falseflip_dev (
bool, optional) – Set this flag to True to flip the vertical dimension of 3D variables in the Dev dataset. Default value: Falseuse_cmap_RdBu (
bool, optional) – Set this flag to True to use a blue-white-red colormap for plotting the raw data in both the Ref and Dev datasets. Default value: Falseverbose (
bool, optional) – Set this flag to True to enable informative printout. Default value: Falselog_color_scale (
bool, optional) – Set this flag to True to plot data (not diffs) on a log color scale. Default value: Falseextra_title_txt (
str, optional) – Specifies extra text (e.g. a date string such as “Jan2016”) for the top-of-plot title. Default value: Noneextent (
list, optional) – Defines the extent of the region to be plotted in form [minlon, maxlon, minlat, maxlat]. Default value plots extent of input grids. Default value: [-1000, -1000, -1000, -1000]n_job (
int, optional) – Defines the number of simultaneous workers for parallel plotting. Set to 1 to disable parallel plotting. Value of -1 allows the application to decide. Default value: -1sigdiff_list (
listofstr, optional) – Returns a list of all quantities having significant differences (where |max(fractional difference)| > 0.1). Default value: Nonesecond_ref (
xarray.Dataset, optional) – A dataset of the same model type / grid as refdata, to be used in diff-of-diffs plotting. Default value: Nonesecond_dev (
xarray.Dataset, optional) – A dataset of the same model type / grid as devdata, to be used in diff-of-diffs plotting. Default value: Nonell_plot_func (
str, optional) – Function to use for lat/lon single level plotting with possible values ‘imshow’ and ‘pcolormesh’. imshow is much faster but is slightly displaced when plotting from dateline to dateline and/or pole to pole. Default value: ‘imshow’**extra_plot_args – Any extra keyword arguments are passed through the plotting functions to be used in calls to pcolormesh() (CS) or imshow() (Lat/Lon).