gcpy.examples.plotting.plot_comparisons

Six Panel Comparison Plots

This example script demonstrates the comparitive plotting capabilities of GCPy, including single level plots as well as global zonal mean plots. These comparison plots are frequently used to evaluate results from different runs / versions of GEOS-Chem, but can also be used to compare results from different points in one run that are stored in separate xarray datasets.

The example data described here is in lat/lon format, but the same code works equally well for cubed-sphere (GCHP) data.

Command-line arguments

-r <str>, --ref <str>

Path to NetCDF file from the Ref model.

-d <str>, --dev <str>

Path to NetCDF output file from the Dev model.

-v <str>, --varname <str>

Variable name to plot.

[-l <int>, --level <int>]

Level to plot (single-level plots only), starting at 0. Default: 0

Examples

Run plot comparisons for ozone from the GEOS-Chem SpeciesConc diagnostic output. Use the 500 hPa level (level 22, starting from 0) for the single-level plots.

$ conda activate gcpy_env
$ python -m gcpy.examples.plotting.plot_comparisons \
  --ref /path/to/ref/GEOSChem.SpeciesConc.20190701_0000z.nc4 \
  --dev /path/to/dev/GEOSChem.SpeciesConc.20190701_0000z.nc4 \
  --varname SpeciesConcVV_O3 \
  --level 22

Notes

If you are using GCPy from a Mac, set the environment variable:

export MPLBACKEND="MacOSX"
export MPLBACKEND="tkagg"

This will set the proper X11 backend (which is needed to open a plot window on the screen. There is some incompatibility with the Tck/Tk backend “tkagg” in MacOS X operating systems.

Functions

main()

Parses command-line arguments and calls plot_comparisons

plot_comparisons_examples(ref, dev, varname, ...)

Example function to create six-panel comparison plots.

gcpy.examples.plotting.plot_comparisons.plot_comparisons_examples(ref, dev, varname, level)[source]

Example function to create six-panel comparison plots.

Parameters:
  • ref (str) – Path to the “Ref” data file.

  • dev (str) – Path to the “Dev” data file.

  • varname (str) – Variable to plot.

  • level (int) – Level to plot (for single-level comparisons only).

gcpy.examples.plotting.plot_comparisons.main()[source]

Parses command-line arguments and calls plot_comparisons