WRF-Python Codes for the Weather Research and Forecasting Model

7 views
Skip to first unread message

Will H

unread,
Jan 8, 2026, 9:11:03 PM (5 days ago) Jan 8
to wrfpython-talk

Hello meteorologists and atmospheric scientists around the globe,

The day is finally here. After months, and honestly years, of development, I am officially finished building the full suite of Python charting scripts I set out to create for NSF NCAR’s Weather Research and Forecasting model, WRF.

Over the years I have been developing Python tools that highlight WRF’s capabilities for operational forecasting and real-world analysis. These scripts were built not only to showcase WRF, but also to be shared with the community for free, especially for meteorologists and atmospheric scientists who may not have much Python experience but still want access to high-resolution graphics, high automation and batch processing, and a wide range of meteorological diagnostics and products. Every script has been standardized across the collection, so the workflow, structure, and commenting style are consistent, making it easier to understand what each script is doing, adapt it to your region, and modify it for your own needs.

On my GitHub page, you will find a folder called “Python Charts that work World.” Inside that folder you will find 93 Python scripts and 5 Bash shell scripts that run the full suite of graphics, including multicore execution options. The products span synoptic and mesoscale dynamics, severe weather diagnostics, and simulated remote sensing, all based directly on WRF output. The goal is to make a complete, automated, operational-ready post-processing package that takes raw WRF output and turns it into briefing-quality graphics with minimal user intervention.

GitHub profile: https://github.com/HathewayWill/

WRF-MOSIT repo: https://github.com/HathewayWill/WRF_Python_Scripts


Compatibility and installation

These scripts are designed to work with the WRF-MOSIT Conda environment using wrf-python, but they can also be used outside of Conda if you install the required Python modules:

numpy, matplotlib, metpy, wrf-python, netCDF4, pillow, scipy, cartopy, geopandas


Map projections and WRF output handling

Each Python script can work with any WRF supported map projection, including Polar, Lat-Lon, Mercator, and Lambert. Each script is also designed to handle multiple WRF output patterns, including a single wrfout file, a single file containing multiple times, or multiple files containing multiple times. The intent is that you should not have to reorganize your output files into a special format to make the scripts work, the scripts are meant to adapt to how WRF is commonly run in real workflows.


Geographic features, boundaries, and city labeling included in the plots

A major focus of this project was making the maps operationally useful the moment they are generated, without requiring manual GIS setup, shapefile hunting, or post-editing. Across the gridded map scripts you will see a consistent approach to adding geographic context through Cartopy features, plus automated city labeling for quick situational awareness, so the output is immediately interpretable in a forecasting or briefing environment.

Cartopy map features used throughout

Many scripts include common Cartopy features so the meteorological fields remain anchored to real geography. Depending on the domain and product, this can include:

  • Coastlines, with resolution appropriate for the map scale

  • International borders and state or province boundaries, when relevant

  • Lakes, rivers, and other water bodies for orientation

  • Land and ocean shading or masking for clean contrast between continents and water

  • Gridlines with labeled latitude and longitude ticks, formatted consistently for readability

  • Optional terrain or topographic context where it matters, such as streamline and terrain plots

Standardized geographic styling

Geographic elements were standardized across the collection so line weights, label sizes, and background features remain consistent from plot to plot. The goal is readability, geographic context supports the meteorological fields without overpowering them, and the overall look and feel stays familiar whether you are viewing upper-air diagnostics, surface fields, cloud products, or precipitation maps.

City and location labeling

Many scripts include city labels to make the output immediately useful for operations and briefings. Labels are intended to support quick orientation and readability in typical WRF domains, often including major cities, airports, and other commonly referenced points, with placement chosen to reduce overlap with filled contours and line contours whenever possible.

Designed to work globally

Because the scripts support Polar, Lat-Lon, Mercator, and Lambert projections, the geographic overlays and labeling logic are built to work anywhere in the world. The intent is that you can run the same workflow whether your domain is over North America, Europe, the Middle East, the tropics, or any other region, and still get a map that is geographically meaningful and presentation-ready.


Metric and Imperial support

You will notice that some scripts have similar names. That is intentional. I developed both Metric and Imperial versions, so the same diagnostic can be produced in the most common unit sets used around the world. In many cases this means paired scripts like millimeters versus inches, kilometers versus miles, meters versus feet, Celsius versus Fahrenheit, knots versus miles per hour. The goal was for a forecaster or researcher to run the exact same suite regardless of location, without having to rewrite unit conversions or maintain separate code bases.


Script categories and included Python filenames1) Upper-Air Dynamics and Synoptic Pattern Diagnostics

Description: Pressure-level maps designed for diagnosing jet structure, trough and ridge placement, forcing for ascent, moisture transport, and overall synoptic and mesoscale evolution. These include classic operational analysis fields adapted for WRF output, produced automatically. Many of these plots combine multiple fields in a single graphic, for example height with isotachs and wind, or humidity with thickness and sea-level pressure, so the output supports real forecasting decisions rather than showing a single field in isolation.

Minimize image
Edit image
Delete image
Minimize image
Edit image
Delete image



2) Moisture, Clouds, and Column Diagnostics

Description: Products focused on moisture availability and cloud field structure for aviation forecasting, convective initiation context, and general cloud interpretation. These scripts are designed to quickly identify deep moisture plumes, saturation patterns, cloud field coverage by layer, and cloud-top thermal structure.

Minimize image
Edit image
Delete image

3) Convective Environment and Severe Weather Diagnostics

Description: Stability and thermodynamic diagnostics intended to summarize the convective environment and changes in instability, inhibition, and parcel buoyancy. These are the types of fields forecasters commonly use to assess convective initiation potential, severe weather environment quality, and evolving mesoscale instability gradients.

  • convective_cape_cin.py

  • mixed_layer_lifted_index.py, slow to run, very computationally heavy

  • surface_based_lifted_index.py, slow to run, very computationally heavy


4) Surface Analysis, Thermodynamics, and Human-Impact Indices

Description: Surface and near-surface products designed for operational forecasting, situational awareness, and briefing graphics. Many include sea-level pressure and wind overlays while emphasizing a target surface parameter. These scripts cover classic surface analysis variables plus human-impact indices commonly used in operations, including heat and cold stress metrics.

  • surface_dewpoint_degc_slp_wind_speed_dir.py

  • surface_dewpoint_degf_slp_wind_speed_dir.py

  • surface_heatindex_degc_slp_wind_speed_dir.py

  • surface_heatindex_degf_slp_wind_speed_dir.py

  • surface_humidex_degc_slp_wind_speed_dir.py

  • surface_relative_humidity_slp_wind_speed_dir.py

  • surface_slp_wind_gust_speed_knots_direction.py

  • surface_slp_wind_gust_speed_mph_direction.py

  • surface_streamlines_terrain_ft.py

  • surface_streamlines_terrain_m.py

  • surface_temp_degc_slp_wind_speed_dir.py

  • surface_temp_degf_slp_wind_speed_dir.py

  • surface_terrain_ft_slp_wind_speed_dir.py

  • surface_terrain_m_slp_wind_speed_dir.py

  • surface_thi_degc_slp_wind_speed_dir.py

  • surface_visibility_km.py

  • surface_visibility_miles.py

  • surface_windchill_degc_slp_wind_speed_dir.py

  • surface_windchill_degf_slp_wind_speed_dir.py

  • road_icing


5) Precipitation, Snowfall, and Snow Water Equivalent Accumulations

Description: Time-accumulated precipitation and winter-weather products at operationally useful intervals. These cover liquid precipitation, snowfall, and snow water equivalent across hourly, multi-hour, daily, and total accumulation windows. These products are meant to support forecasting of rainfall rates, storm totals, winter storm impacts, and hydrologic context, with Metric and Imperial variants built in.


6) Simulated Remote Sensing and Radar-Style Products

Description: Simulated observational-style products intended to provide a radar-like view of convective structure and precipitation intensity derived from WRF fields. This is meant to help bridge the gap between model output and what forecasters are used to interpreting in real time.


7) Fire Weather Indices and Stability-Based Fire Diagnostics

Description: Fire weather focused diagnostics designed to highlight atmospheric stability and dryness patterns commonly used in wildfire forecasting and fire behavior discussions. These provide quick environmental context for plume-dominated fire potential and stability regimes.


8) Point-Based Forecast Graphics and Vertical Profile, Cross-Section Diagnostics

Description: Site-specific and vertical diagnostic plots for stations or user-defined latitude and longitude points. These complement the gridded maps with time series, thermodynamic profiles, and vertical structure views. They are meant for forecasting at specific airports, cities, incident locations, research sites, and decision support points.


9) Tropical Surface Diagnostics

Description: Tropical-focused surface products emphasizing sea-level pressure, winds, gusts, and sea surface temperature, with Metric and Imperial options. These are designed to support tropical cyclone monitoring, trade wind regime diagnosis, and tropical marine forecasting workflows.

  • tropical_surface_slp_wind_gust_speed_knots_direction.py

  • tropical_surface_slp_wind_gust_speed_mph_direction.py

  • tropical_surface_slp_wind_speed_knots_direction.py

  • tropical_surface_slp_wind_speed_mph_direction.py

  • tropical_surface_sst_degc_slp_wind_speed_dir.py

  • tropical_surface_sst_degf_slp_wind_speed_dir.py


How you run them

The five Bash shell scripts are designed to automate execution. They can activate the appropriate environment, locate or accept a WRF output directory, create date-stamped output folders, and run the chart suite in a structured way across domains, including multicore parallel processing where configured. The intent is that you can generate an entire forecast graphics package in one run, organized by domain and location, without manually running dozens of individual commands.


Why I built this

The purpose of this project is simple, make high-quality WRF post-processing graphics easier for the broader community to use, including those who have never written a Python script. If you are already comfortable in Python, you can also treat this as a base framework, the scripts are standardized so you can add additional diagnostics in a consistent way, and keep your own additions aligned with the rest of the suite.

Reply all
Reply to author
Forward
0 new messages