Visualizing KPP-Standalone box model output

This page describes how you can plot results from the KPP-Standalone box model with GCPy.

Creating plots from KPP-Standalone output

Quick-look plots

You can use GCPy gcpy.kpp.kppsa_quick_look() to generate a vertical profile for a given species at a given observation site. This can be useful as a quick-look sanity check.

Type this at the command line:

$ conda activate gcpy_env
(gcpy_env) $ python -m gcpy.kpp.kppsa_quick_look \
 --dirname /path/to/KPP-Standalone/output        \
 --label   Rosenbrock                            \
 --pattern Beijing*20190701_0040.log             \
 --species O3

which will generate this plot:

_images/kppsa_quick_look.png

Vertical profiles at multiple observation sites

You can use GCPy module gcpy.kpp.kppsa_plot_sites() to generate vertical profile plots for a given species at multiple observation locations.

Type this at the command line:

conda activate gcpy_env
(gcpy_env) $ python -m gcpy.kpp.kppsa_plot_sites  \
 --refdir   /path/to/KPP-Standalone/Ref/log/files \
 --reflabel Rosenbrock                            \
 --devdir   /path/to/KPP-Standalone/Dev/log/files \
 --devlabel Backwards Euler                       \
 --pattern  20190701_0040.log                     \
 --species  O3                                    \
 --pdfname  KPP-Standalone-O3-20190701-0040.pdf

This will create a PDF file with several pages. Each page will look similar to this:

_images/kppsa_plot_sites.png

In some instances (such as in the plot above), the Dev simulation (blue line) will overlap the Ref simulation (red line). This indicates that Dev has produced identical or nearly-identical results to Ref.

Source code reference

List of functions

Functions for reading and plotting KPP-Standalone box model output

Function

Description

gcpy.kpp.kppsa_quick_look()

Creates a “quick-look” vertical profile plot. Useful as a sanity check.

gcpy.kpp.kppsa_plot_sites()

Creates vertical profile plots of a given species at various locations.

gcpy.kpp.kpp_utils.kppsa_get_file_list()

Returns a list of KPP-Standalone log files matching a search criteria.

gcpy.kpp.kppsa_utils.kppsa_read_one_csv_file()

Reads a single log file (in CSV format) from the KPP standalone box model into a pandas.DataFrame object.

gcpy.kpp.kppsa_utils.kppsa_read_csv_files()

Reads all KPP standalone log files for a given site in a given directory.

gcpy.kpp.kppsa_utils.kppsa_prepare_site_data()

Returns a pd.DataFrame object containing data for a given species, and observation site, as well as the corresponding top-of-plot title.

gcpy.kpp.kppsa_utils.kppsa_plot_single_site()

Plots observation data vs. model data at a single station site.

gcpy.kpp.kppsa_utils.kppsa_plot_one_page()

Plots a single page of models vs. observations.

gcpy.kpp.kppsa_utils.kppsa_get_unique_site_names()

Returns a list of unique sites where KPP-Standalone box model output has been archived.