NCAR / container-dtc-nwp

End-to-end NWP systems in containers.
https://dtcenter.org/community-code/numerical-weather-prediction-nwp-containers
28 stars 13 forks source link

Python plotting mods/enhancements (feature/python plotting) #49

Closed michelleharrold closed 3 years ago

michelleharrold commented 3 years ago

This PR addresses several Python plotting-related issues and enhancements. Changes have been made to speed up the plotting, address issue with contouring, and issues with unphysical 500 hPa absolute vorticity values around domain border.

To speed up the plotting, a single Python script (ALL_plot_allvars.py) is now used to plot the 10 variables of interest. Transitioning from 10 individual scripts reduced I/O time. An option to run the individual scripts is still in the run_python.ksh script, but it is commented out.

To address the contouring issues and the unphysical border in the 500 hPa absolute vorticity plots, changes were made to the ALL_plot_allvars.py script as well as plot_slp.py and plot_500mbH_W_Vort.py. Logic was added to these scripts to not plot contour lines if the range of the SLP and 500 hPa heights was smaller then a specified range. In addition, for 500 hPa absolute vorticity, the Gaussian smoothing was reduced (to 0.5) to alleviate the border of unphysical values around the domain edge.

A small change was also made for plotting 2-5 km max UH to modify the colorbar min/max values.

Finally, while not related to Python plotting, in testing, an issue was discovered with running GSI with the snow case. This issue is addressed by adding the PREPBUFR environment variable under the ‘GSI settings’ to the set_env.ksh file under scripts/snow_20160123.

Testing done: Ran sandy, snow, and derecho cases with the ALL_plot_allvars.py script and the individual plotting scripts to ensure the same behavior/output and to ensure new mods/changes were implemented as intended. Visually inspected plots to make sure contouring issues and issues with 500 hPa absolute vorticity have been addressed. Testing was done with v3.4 tag of code components on a Mac.

fossell commented 3 years ago

I will test this feature branch and see if I encounter the same border issues as Jamie. In old python plots I tested from Workshop this spring do not have the strange border.

michelleharrold commented 3 years ago

As a note, I tried running with the 'trim' command commented out, and while it allowed for whitespace around the plot, I didn't get the strange border. I am perplexed!

fossell commented 3 years ago

Just a quick update, I am still not able to test this due to continuing build issues.

michelleharrold commented 3 years ago

@fossell -- I didn't make any changes to the Dockerfiles for this PR, and I tested with pulling the v3.4 images from DockerHub. Would that be an option for testing?

fossell commented 3 years ago

@michelleharrold - Doh! Yes, yes I can. I've been so entrenched in the build failures lately forgot about existing images!

Tested the updated python scripts with 3.4 tagged images from Dockerhub and everything was successful. No indication of the weird border lines that Jamie had. Example of SLP plot:

image