The primary task that I completed this summer was adding METAR functionality to MetPy. METAR stands for METeorological Aerodrome Report. METARs contain information about surface data including temperature, dew point, wind speed and direction, and several other meteorological variables. Prior to this summer, MetPy did not have the ability to parse METARs. Also, the current parser that is used to generate netCDF files on the Unidata THREDDS server had a substantial amount of missing data. By adding METAR parsing tools, we made additional surface data available to the user, making it easier to make high quality surface maps using MetPy.
METARs can be encoded by either computers or humans — which can make decoding difficult. Despite having structural guidelines determined by the World Meteorological Organization, there are numerous errors in the observations which cause headaches when attempting to parse out the information. Using Canopy, a parser compiler, a parsing tree was created that is flexible enough to be able to parse out the most important information relevant for station plots including: temperature, dew point, station identifier, time, day of month, along with all the other variables before the remarks section.
The METAR parsing functionality works either with single strings of text or with text files like those delivered by Unidata's Local Data Manager (LDM). The parser takes the text, parses out the surface observations, then appends them to a single Pandas dataframe. Pandas dataframes are useful in Python because they are easy to subset and assign units to. The data stored in the dataframes can then be used with the Station Plot functionality already in MetPy to create surface maps.
One of MetPy's goals is to provide the functionality to replace the General Meteorology Package (GEMPAK). GEMPAK can be used to visualize meteorological data, ranging from GOES-16 satellite imagery to surface data. Previous interns have worked on adding sounding calculations and cross sections, which are useful for a wide variety of applications. MetPy still lacks the ability to make surface maps using a simplified declarative interface. Through using the new METAR parsing functionality, a simplified plotting interface can be implemented which will make it easier for new users to create publication quality maps. Instead of using 30-40 lines of code, the new plotting interface will be able to plot surface data onto a station map in about 10 lines.
Unidata Workshop at Albany
Before I even started on my METAR decoding journey, I flew to Albany, New York to aid in teaching the Unidata Python Workshop at the University at Albany, SUNY. Ryan May and I taught professors, students, and others interested in learning how to use Python for meteorological applications.