The information comes from the National Oceanic and Atmospheric Association’s raw data source.
-
Parses METAR strings using a state machine.
This prints the latest weather report for Portland International Airport:
require ‘rubygems’ require ‘metar’
raw = Metar::Raw.new( ‘KPDX’ ) parser = Metar::Parser.new( raw ) report = Metar::Report.new( parser )
puts report.to_s
-
WMO
-
www.wmo.int/pages/prog/www/WMOCodes/Manual/Volume-I-selection/Sel2.pdf (pages 27-38)
-
dcaa.slv.dk:8000/icaodocs/Annex%203%20-%20Meteorological%20Service%20for%20International%20Air%20Navigation/Cover%20sheet%20to%20AMDT%2074.pdf (Table A3-2. Template for METAR and SPECI)
-
-
United states:
Other Ruby libraries offering METAR parsing:
-
ruby-metar - github.com/brandonh/ruby-metar
-
ruby-wx - hans.fugal.net/src/ruby-wx/doc/
There are many reports (WMO) that these libraries do not parse.
There are two gems which read the National Oceanic and Atmospheric Association’s XML weather data feeds:
-
noaa-weather - Ruby interface to NOAA SOAP interface
-
noaa - github.com/outoftime/noaa
Interactive map:
The tests use a local copy of the weather stations list: data/nsd_cccc.txt
If missing, the file gets downloaded before running tests.