-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Initial WRF plotting script, functions, and README for the Hurricane Matthew case. * add Dockerfile to create iwrf-metplus image and update instructions to use that container * make script executable * create directory containing output file if it does not already exist * change default input and output directories to use paths assumed in Docker container * mount directory containing WRF plotting script to container * run WRF plotting script as part of METplus use case * Per #50, update instructions to use I-WRF METplus Docker container that includes METplotpy, METcalcpy, METdataio, and wrf python packages. Mount the Hurricane Matthew Visualization directory so the plotting scripts can be found. The WRF plotting script is called from the METplus use case run * remove commented code * remove characters that should not be rendered in the docs * cleanup usage statement * Per request on @Trumbore on pull request review, updated WRF log output to include updated content. --------- Co-authored-by: Jared A. Lee <jaredlee@ucar.edu> Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
- Loading branch information
1 parent
c9e7704
commit fab3623
Showing
9 changed files
with
1,359 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ARG METPLUS_TAG=6.0.0-beta5 | ||
|
||
FROM dtcenter/metplus-analysis:${METPLUS_TAG} | ||
|
||
# install wrf python package from branch in PR NCAR/wrf-python#242 | ||
# because wrf will not install from pip | ||
RUN python3 -m pip install --upgrade pip \ | ||
&& python3 -m pip install git+https://github.com/DWesl/wrf-python.git@cmake-build \ | ||
&& python3 -m pip install cartopy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# plot_wrf | ||
Python scripts and functions to make nice plots of WRF model output using Cartopy. | ||
|
||
plot_wrf.py can be called with a set of arguments (use option -h to get the current usage statement): | ||
|
||
``` | ||
> python plot_wrf.py -h | ||
usage: plot_wrf.py [-h] [-w WRF_DIR_PARENT] [-o OUT_DIR_PARENT] [-f CYCLE_DT_FIRST] [-l CYCLE_DT_LAST] | ||
[-i CYCLE_STRIDE_H] [-b BEG_LEAD_TIME] [-e END_LEAD_TIME] [-s STR_LEAD_TIME] [-d DOMAIN] | ||
options: | ||
-h, --help show this help message and exit | ||
-w WRF_DIR_PARENT, --wrf_dir_parent WRF_DIR_PARENT | ||
string specifying the directory path to the parent WRF output directories, above any | ||
experiment or cycle datetime subdirectories (default: /data/input/wrf) | ||
-o OUT_DIR_PARENT, --out_dir_parent OUT_DIR_PARENT | ||
string specifying the directory path to the parent plot directories (default: /data/output/wrf) | ||
-f CYCLE_DT_FIRST, --cycle_dt_first CYCLE_DT_FIRST | ||
beginning date/time of first WRF simulation [YYYYMMDD_HH] (default: 20161006_00) | ||
-l CYCLE_DT_LAST, --cycle_dt_last CYCLE_DT_LAST | ||
beginning date/time of last WRF simulation [YYYYMMDD_HH] | ||
-i CYCLE_STRIDE_H, --cycle_stride_h CYCLE_STRIDE_H | ||
stride in hours between cycles (default: 24) | ||
-b BEG_LEAD_TIME, --beg_lead_time BEG_LEAD_TIME | ||
beginning lead time for plotting WRF simulations [HH:MM] (default: 00:00) | ||
-e END_LEAD_TIME, --end_lead_time END_LEAD_TIME | ||
ending lead time for plotting WRF simulations [HH:MM] (default: 48:00) | ||
-s STR_LEAD_TIME, --str_lead_time STR_LEAD_TIME | ||
stride to create plots every N minutes (default: 180) | ||
-d DOMAIN, --domain DOMAIN | ||
WRF domain number to be plotted (default: 1) | ||
``` | ||
|
||
The plot_wrf.parse_args function creates a dictionary of options that is then passed to the main routine. Doing this via a dictionary object should make it simpler to add even more customization/options in the future, requiring changes in fewer places than passing numerous positional arguments around. | ||
|
||
The plot_wrf script opens specified wrfout files in sequence, reads in user-specified variables (currently set with options like plot_TERRAIN = True and plot_T2 = False in the main function), creates a dictionary of plotting options that is then passed to map_funcs.map_plot to create and save each plot to a file. Inside the main function there are also user-settable boolean flags to turn on/off plotting surface wind barb overlays, labeled stations/cities, etc. | ||
|
||
Both these requested variables for plotting and other plot customization options could eventually be changed to be passed in on the command line to not require users to modify the script itself before running it, but that is left for future development. |
Oops, something went wrong.