gcpy.plot.compare_zonal_mean

gcpy.plot.compare_zonal_mean(refdata, refstr, devdata, devstr, varlist=None, itime=0, refmet=None, devmet=None, weightsdir='.', pdfname='', cmpres=None, match_cbar=True, pres_range=None, normalize_by_area=False, enforce_units=True, convert_to_ugm3=False, spcdb_files=None, flip_ref=False, flip_dev=False, use_cmap_RdBu=False, verbose=False, log_color_scale=False, log_yaxis=False, extra_title_txt=None, n_job=-1, sigdiff_list=None, second_ref=None, second_dev=None, ref_vert_params=None, dev_vert_params=None, **extra_plot_args)[source]

Creates 3x2 comparison zonal-mean 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 (list of str, optional) – List of xarray dataset variable names to make plots for. Default value: None (will compare all common 3D variables)

  • itime (int, optional) – Dataset time dimension index using 0-based system. Default value: 0

  • refmet (xarray.Dataset, optional) – Dataset containing ref meteorology. Default value: None

  • devmet (xarray.Dataset, optional) – Dataset containing dev meteorology. Default value: None

  • weightsdir (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 to use same the colorbar bounds for both Ref and Dev plots. Default value: True

  • pres_range (list of int, optional) – Pressure range of levels to plot [hPa]. The vertical axis will span the outer pressure edges of levels that contain pres_range endpoints. Default value: [0, 2000]

  • normalize_by_area (bool, optional) – Set this flag to True to to normalize raw data in both Ref and Dev datasets by grid area. Input ref and dev datasets must include AREA variable in m2 if normalizing by area. Default value: False

  • enforce_units (bool, optional) – Set this flag to True force an error if the variables in the Ref and Dev datasets have different units. Default value: True

  • convert_to_ugm3 (str, optional) – Whether to convert data units to ug/m3 for plotting. Default value: False

  • spcdb_files (str or list, optional) – A single species_database.yml file or a list of files (e.g. for Ref & Dev). Only used when convert_to_ugm3=True. Default value: None

  • flip_ref (bool, optional) – Set this flag to True to flip the vertical dimension of 3D variables in the Ref dataset. Default value: False

  • flip_dev (bool, optional) – Set this flag to True to flip the vertical dimension of 3D variables in the Dev dataset. Default value: False

  • use_cmap_RdBu (bool, optional) – Set this flag to True to use a blue-white-red colormap for plotting raw reference and development datasets. Default value: False

  • verbose (bool, optional) – Set this flag to True to enable informative printout. Default value: False

  • log_color_scale (bool, optional) – Set this flag to True to enable plotting data (not diffs) on a log color scale. Default value: False

  • log_yaxis (bool, optional) – Set this flag to True if you wish to create zonal mean plots with a log-pressure Y-axis. Default value: False

  • extra_title_txt (str, optional) – Specifies extra text (e.g. a date string such as “Jan2016”) for the top-of-plot title. Default value: None

  • 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: -1

  • sigdiff_list (list of str, optional) – Returns a list of all quantities having significant differences (where |max(fractional difference)| > 0.1). Default value: None

  • second_ref (xarray.Dataset, optional) – A dataset of the same model type / grid as refdata, to be used in diff-of-diffs plotting. Default value: None

  • second_dev (xarray.Dataset, optional) – A dataset of the same model type / grid as devdata, to be used in diff-of-diffs plotting. Default value: None

  • ref_vert_params (list of array-like, optional) – Hybrid grid parameter A in hPa and B (unitless). Needed if ref grid is not 47 or 72 levels. Default value: None

  • dev_vert_params (list of array-like, optional) – Hybrid grid parameter A in hPa and B (unitless). Needed if dev grid is not 47 or 72 levels. Default value: None

  • **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).