Go to file
2023-08-25 20:27:50 -07:00
airports Make JSON keys for airports more user-friendly 2023-08-22 17:54:41 -07:00
cmd/tafparser Improve error message 2023-08-25 20:27:50 -07:00
internal/parser Initial Commit 2023-08-21 16:56:17 -07:00
units Add mph and km units 2023-08-22 19:52:41 -07:00
.gitignore Initial Commit 2023-08-21 16:56:17 -07:00
convert.go Remove abbreviations to make decoded reports easier to read 2023-08-22 17:34:26 -07:00
go.mod Use the new scalarliterals option for repr 2023-08-22 21:08:50 -07:00
go.sum Use the new scalarliterals option for repr 2023-08-22 21:08:50 -07:00
LICENSE Initial Commit 2023-08-21 16:56:17 -07:00
README.md Add -i flag 2023-08-25 20:22:16 -07:00
taf_test.go Fix handling of PROB groups 2023-08-25 20:08:09 -07:00
taf.go Fix handling of PROB groups 2023-08-25 20:08:09 -07:00
time.go Fix time parsing and make tests deterministic 2023-08-22 19:11:58 -07:00
types.go Add doc comments to Forecast and associated types 2023-08-25 14:38:24 -07:00

taf

Go Report Card Go Reference

This is a library and command-line tool that parses and decodes TAF forecasts.

TAF stands for Terminal Aerodrome Forecast. It's the weather forecast format used in aviation. TAF reports are useful as a free source of accurate weather.

Here's an example of a TAF report from JFK airport:

KJFK 212335Z 2200/2306 33012G18KT P6SM FEW060 BKN250
  FM220300 36014KT P6SM FEW060 SCT150
  FM221400 01015G21KT P6SM SCT060
  FM221900 04011KT P6SM SCT060
  FM230000 03007KT P6SM FEW060
  FM230300 35006KT P6SM FEW060

Try parsing it by installing the tafparser tool using

go install go.elara.ws/taf/cmd/tafparser@latest

and then running

tafparser <<EOF
KJFK 212335Z 2200/2306 33012G18KT P6SM FEW060 BKN250
  FM220300 36014KT P6SM FEW060 SCT150
  FM221400 01015G21KT P6SM SCT060
  FM221900 04011KT P6SM SCT060
  FM230000 03007KT P6SM FEW060
  FM230300 35006KT P6SM FEW060
EOF

That should return a JSON object containing all the decoded data from the TAF report.

You can also give the tafparser tool a file to read from using tafparser file.txt.

Units in TAF reports are inconsistent between different countries. tafparser can convert the units for you! Just pass it the units you want to use for speed and/or distance like so:

tafparser -s m/s -d m

This tells tafparser to convert all speed units to meters per second and distance units to meters.

tafparser can also fetch TAF reports for you using the aviationweather.gov site. Use the -i <identifier> flag to tell it to do that, like so:

tafparser -i EGLL

That should automatically fetch the report for London Heathrow and parse it.