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:
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:
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
Function |
Description |
|---|---|
Creates a “quick-look” vertical profile plot. Useful as a sanity check. |
|
Creates vertical profile plots of a given species at various locations. |
|
|
Returns a list of KPP-Standalone log files matching a search criteria. |
Reads a single log file (in CSV format) from the KPP standalone box model into a pandas.DataFrame object. |
|
Reads all KPP standalone log files for a given site in a given directory. |
|
Returns a pd.DataFrame object containing data for a given species, and observation site, as well as the corresponding top-of-plot title. |
|
Plots observation data vs. model data at a single station site. |
|
Plots a single page of models vs. observations. |
|
Returns a list of unique sites where KPP-Standalone box model output has been archived. |