Skip to main content

Command Palette

Search for a command to run...

I have a new project! METARdecode

A terminal based aviation weather report decoder

Published
3 min read
I have a new project! METARdecode

Aviation has been one of my greatest interests since childhood. While I've never become a pilot (yet), I'm fascinated by all aspects, from hobbyist private flying to commercial aviation. One amazing resource on the Internet is the ability to listen to live Air Traffic Control traffic for nearly any region or airport without needing to own your own radio equipment.

When listening to ATC, I like having two resources easily available. A map of the airport and the current weather conditions. Both of these will allow easier understanding of what you are hearing. METAR (Meteorological Terminal Air Report) is a format for reporting weather information for pilots. A significant amount of information is squeezed into a small series of text blocks, giving the current conditions for a specific airport. Pilots use these reports when planning flights or assessing current conditions.

METAR provides data such as windspeed and direction, cloud cover, temperature, dew point and barometric pressure, which is needed to properly set an aircraft's altimeter. It also includes a whole host of remark comments to indicate conditions such as thunderstorm, hail, snow and lightning. All of these conditions can be difficult to decipher if you are not a trained pilot.

METAR decoding applications are not new, and a quick google search will find many available options. For my own personal use, I was looking for a decoder that I could use quickly. I always have a terminal window open no matter what operating system I'm using, so I thought, why not just make a simple terminal decoder?

The METAR specification allows for many optional elements, so it's not always straight forward to parse each section. You can't always expect a certain section to exist in a specific position. One of the best solutions for this is using Regular Expressions. I encounter Regex periodically in my professional life, either having to decode how a previously written Regex works or writing an entirely new Regex to match a pattern. Regex is a skill that can quickly be lost, so this project was an opportunity to keep those skills fresh.

METARdecode is a .NET core application written in C# that is capable of taking either a full METAR report or just an ICAO airport code as a parameter. If an ICAO code is used, the raw METAR report will be retrieved via the AVWX API service. A human readable version of the weather report is then displayed in the terminal.

I wrote the application in C# as that's the primary language I work in professionally. .Net core was a no-brainer as it's easily portable between different architectures. And as an API developer, it wasn't complete until it was capable of retrieving the raw METAR data from an external source.

Currently METARdecode supports all USA METAR reports. I'm currently working to add several enhancements including providing human readable translation of all Remark codes (Remarks are appended at the end of the report and explain various optional conditions), error handling and further integration with the AVWX API.

If you are interested in poking around, METARdecode is available on my GitHub below:

https://github.com/tclevdev/METARdecode