Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts to plot vertical profiles from the KPP-Standalone box model #346

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

yantosca
Copy link
Contributor

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Describe the update

We have added Python scripts to plot vertical profiles to the gcpy/kpp folder. These scripts are

Script Description
kppsa_utils.py Contains utility routines for reading and plotting KPP-Standalone box model output
kppsa_quick_look.py Creates a "quick-look" vertical profile plot for a given KPP-Standalone box model location.
kppsa_plot_sites.py Creates a table of plots for a given species at several KPP-Standalone box model locations.

Expected changes

This update is zero-diff w/r/t the GEOS-Chem benchmark plots & tables.

Quick-look plots:

This command

$ python -m gcpy.kpp.kppsa_quick_look                    \
  --dirname  "/path/to/KPP-Standalone/box/model/output"  \
  --label    "Rosenbrock"                                \
  --pattern  "Beijing*20190701_0040.log"                 \
  --species  "O3"                                        \

produces this "quick-look" plot for a single box model output site and species.
kppsa_quick

Vertical profiles of a given species at several sites

This command

$ python -m gcpy.kpp.kppsa_plot_sites                                  \
  --refdir   "/path/to/KPP-Standalone/box/model/Ref/version"           \
  --reflabel "Rosenbrock"                                              \
  --devdir   "/path/to/KPP-Standalone/box/model/Dev/version"           \
  --devlabel "LSODE 4th order"                                         \
  --pattern  "20190701_0040.log"                                       \
  --species  "O3"                                                      \
  --pdfname "./O3.pdf"

produces a PDF file containing vertical profiles for O3 at several box model output locations. Each page will look similar to this:
kppsa_sites

NOTE: I chose the range 1000..500 hPa to highlight the area of greatest interest. Above this the profiles look mostly identical.

Related Github Issue

Tagging @lizziel @obin1 @viral211

gcpy/examples/__init__.py
- Import all routines in scripts contained in the
  gcpy/examples/kpp folder

gcpy/examples/kpp/kppsa_visualize.py
- Initial commit of script to visualize output from the KPP standalone
  model.  Places plots of each species from all sites sorted from
  the North Pole to the South Pole.  Further updates will be necessary.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
gcpy/examples/__init__.py
- Removed "from ,kpp import*"

gcpy/kpp/__init__.py
- Added this import script for the gcpy/kpp folder

gcpy/kpp/kppsa_utils.py
- Moved most of the routines from the former
  gcpy/examples/kpp/kppsa_visualize.py script here
  so that they can be reused

gcpy/kpp/kppsa_plot_sites.py
- Added this script to plot KPP-Standalone box model output
  (Ref vs. Dev versions) from 500-1000 hPa.  Based on the former
  kppsa_visualize.py script.

gcpy/kpp/kppsa_quick_look.py
- Added this script to create "quick-look" output from the
  KPP-Standalone box model output

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca added category: Feature Request New feature or request topic: Utilities Related to utility functions & convenience routines labels Dec 11, 2024
@yantosca yantosca added this to the 1.6.0 milestone Dec 11, 2024
@yantosca yantosca self-assigned this Dec 11, 2024
@yantosca
Copy link
Contributor Author

yantosca commented Dec 11, 2024

Oops I noticed that there is a problem w/ the lat & lon in the plot titles. I'll fix that.

gcpy/kpp/kppsa_utils.py
- Use os.path.expanduser instead of os.path.abspath to replace
  "~" in input paths instead of os.path.abspath
- Set the default pressure range to 1020..500 for now.  We may add
  the pressure range as an input variable later

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Feature Request New feature or request topic: Utilities Related to utility functions & convenience routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant