3.6 Using Python and QGIS to Display Continuously Updated Near Real-time Global Weather Observations

Monday, 23 January 2017: 5:15 PM
Conference Center: Chelan 5 (Washington State Convention Center )
Joseph M Stepansky, Harrisburg, PA

The Meteorological Terminal Aviation Routine Weather Report (METAR) is a widely used format for disseminating global surface weather observations. Weather stations around the world transmit hundreds of METAR formatted observations hourly. The observations consist of “regular” hourly observations and “special” observations transmitted as often as necessary during rapidly changing weather conditions.

The powerful capabilities of Python and PyQGIS (Python scripting within QGIS) allow creation of a continuously updated graphical display of worldwide surface observations in near real-time. These capabilities also allow development of a simple method for automatically and continuously highlighting changing weather conditions.

Python code automatically downloads and decodes, at five minute intervals, the most recently transmitted METAR observations. Additional Python code uses the decoded data to create text files used by QGIS. The text files contain information on weather stations whose latest observations include rain (of any intensity), tornadoes, thunderstorms, cloudiness, snow and other frozen precipitation. Text files are also created for very hot (>=100F/37.8C) and very cold (<=0F/-17.8C) reported temperatures.

PyQGIS code automatically imports the text files into QGIS to provide a color-coded display of all received global surface weather observations. Colors used are red (tornado), yellow (thunderstorm), green (rain), light blue (snow), pink (frozen), orange (hot), blue (cold) and gray (cloudy), white (partly cloudy or clear). Precipitation types reported in the most recent data file are circled in red to denote new or “special” weather observations. HTML is used within QGIS to allow viewing of any station’s most recent observation by simply moving the mouse pointer over the station’s location.

This display can also be enhanced with additional layers such as Storm Prediction Center Convective Outlooks and Weather Prediction Center Quantitative Precipitation Forecasts.

This presentation will discuss the procedure for using Python and PyQGIS to take raw METAR observations and prepare them for QGIS display. It will also provide display examples showing observations on global, regional and local scales.

- Indicates paper has been withdrawn from meeting
- Indicates an Award Winner