This go program is a console (terminal) mode program to fetch the aviation METAR's and TAF's for a given list of airports and other weather stations. Special care has been put into execution speed using the goroutines for concurrent data retrieval of METAR's and TAF's.
As an addition to the METAR messages, Wind Chill factor, Heat Factor and Relative Humidity are computed when applicable.
-n <n> Set number of Metars to print per station. N: 1 to 70
-s <string> Search IATA/ICAO code for an airport
-lc <string> List all countries with their ISO code (<string> may be empty)
-la <string> List all airports in one or more countries (ISO country codes)
-t <t> Connection timeout T: 1 to 10
-r Print raw data w/o the additional factors
-m METARS only (mutually exclusive with -f)
-f TAFS only (mutually exclusive with -m)
-h This help screen
$ metar cdg FACT
(Case insensitive)
The output looks like this:
LFPG (CDG) Charles de Gaulle International Airport (Paris), France FR (EU)
LFPG 060600Z 03003KT CAVOK 19/10 Q1017 NOSIG [19 19 56%]
LFPG 060530Z 02004KT CAVOK 17/09 Q1017 NOSIG [17 17 59%]
LFPG 060500Z 02006KT CAVOK 17/09 Q1017 NOSIG [17 17 59%]
LFPG 060430Z 03005KT CAVOK 16/09 Q1017 NOSIG [16 16 63%]
TAF 060500Z 0606/0712 04005KT CAVOK TX36/0712Z TN17/0606Z
FACT (CPT) Cape Town International Airport (Cape Town), South Africa ZA (AF)
FACT 060600Z VRB02KT 9999 FEW030 BKN045 07/06 Q1030 NOSIG [7 7 93%]
FACT 060500Z VRB01KT 9999 -RA FEW035 BKN045 07/06 Q1030 NOSIG [7 7 93%]
FACT 060400Z 05004KT 9999 FEW035 BKN050 06/05 Q1029 NOSIG [5 6 93%]
TAF 060400Z 0606/0712 03005KT 9999 SCT020 BKN030 TX17/0712Z TN08/0706Z FM061300 18013KT CAVOK FM062300 VRB03KT CAVOK
At the end of the METAR's, the three values between brackets are the computed [ wind chill factor | heat factor | relative humidity % ]
$ metar -s munich
$ metar -s new york
$ metar -lc
$ metar -lc africa
$ metar -la fr
$ metar -la it pt es uk
$ metar -h
You will have to compile the sources using the golang tools. Follow this howto to get you started. The compilation is lightning fast and the cross-compilation easy.
If you don't want to compile it yourself, skip the points below and go the binaries
- Easy way: install the latest version binaries or use your distro package (not always the latest version)
- Less easy way: compile Go from source
go get github.com/esperlu/metar
This will install this git repo in the directory defined in yourGOPATH
environment variable.- navigate to the now local sources
<GOPATH>/src/github.com/esperlu/metar
- give it a try:
go run metar.go bru jfk
- if successfull, compile the metar sources and data:
go build metar.go
orgo install metar.go
to install the binary in the binary folder defined in theGOBIN
environment variable to make it accessible and executable system wide.
You can also use the binaries that I have cross-compiled for your convenience.
OS | Architecture | Direct link |
---|---|---|
Linux 64 bit | amd64 | download |
Linux | arm v5 | download |
Linux RPi-1 (Zero, A, A+, B, B+) 32-bit | arm v6 | download |
Linux RPi-2B 32-bit | arm v7 | download |
Darwin (OS X) | amd64 | download |
Windows 32-bit | 386 | download |
Windows 64-bit | amd64 | download |
Once downloaded Linux and Mac users will have to make that file executable: $ chmod +x metar
To run it (Linux and Mac): $ ./metar
Rough edges are not excluded. Please report any bugs.
METAR weather messages are retrieved from NOAA's aviationweather.gov in real time. METAR station list and names are compiled from and aviationweather.gov and ourairports.com