These are Windows and command-line (AKA console) versions of a utility which will decode a METAR
weather-information string. METAR strings are displayed on many online
weather pages; while they are typically incomprehensible to humans,
they are (relatively) easily parsed by computers. A typical METAR string
looks like this:
METAR KLVK 141853Z 30009KT 10SM CLR 28/09 A2996 RMK AO2 SLP140 T02830094
Metar.exe will decode this string and present an output such as this:
*****************************************************
INPUT METAR REPORT:
METAR KLVK 141853Z 30009KT 10SM CLR 28/09 A2996 RMK AO2 SLP140 T02830094
/*******************************************/
/* DECODED METAR REPORT
/*******************************************/
REPORT CODE NAME : METAR
STATION ID : KLVK: LIVERMORE, CA, loc 37.42N, 121.49W, elev 117 meters
OBSERVATION DATE : 14th, 1853
WIND DIRECTION : 300
WIND SPEED : 9
WIND UNITS : KT
PREVAIL VSBY (SM) : 10.000
CLOUD COVER : CLR
TEMP. (degsF) : 82
D.P. TEMP. (degsF) : 48
ALTIMETER (INCHES) : 29.96
AUTO INDICATOR : AO2
SLP (hPa) : 1014.0
TMP2TENTHS (degsF) : 82.9
DPT2TENTHS (degsF) : 48.9
WMetar - WinAPI version of this program
WMetar is freeware, source code is available below.
Download WMetar program and data here
Download WMetar source code here
Using the Metar command-line utility
Executing the utility with no arguments will present a usage screen:
> metar
Usage: metar [options] [optional METAR string]
Options:
-f show temperatures in Fahrenheit vs Celsus
-t run the build-in test vectors
NOTE: settings options *must* precede a METAR string!
So, to get the output shown above, I entered:
metar -f "METAR KLVK 141853Z 30009KT 10SM CLR 28/09 A2996 RMK AO2 SLP140 T02830094"
Note that the METAR string must be enclosed in quotes.
Metar is freeware, source code is available below.
Download Metar utility here
Download Metar source code here
Background on this program
The original METAR Decoder Software Package that this utility is based
upon, originally was provided by the National Weather Service, according to
Eric McCarthy, who maintains
a website devoted to the package, and did some development on it in the
early 2000s.
In 2011, he moved the project to
SourceForge, where I found
the code that I started with. Unfortunately, this code base does not build
with Gnu gcc, so I had to do some work on it. Once it was building, I added
some features to it, including allowing passing of the METAR string from the
command line, and I also added support for the stations.txt file which is
maintained by
Greg Thompson.
This file allows the program to translate the Station ID (KLVK in the
above example) into useful location description and information.
Metar is written in standard C,
and builds on Windows and Linux. The Windows version is built using the
open source MinGW (Minimal Gnu for Windows) tools,
and requires a couple of the common utilities from Cygwin as well
(Gnu make, rm, etc).