Up |
Decode a METAR and return (almost) all weather informations "AS IT".
In the most cases, you could use _scienceWeatherDecodeMetarLight instead (easier).
fun [S I] [S S S S S S S S S S S S S S S S S S S S]
Return : [S S S S S S S S S S S S S S S S S S S S] nil if error or :
Some return values can be unavailables, depends on the meteorological situation.
_scienceWeatherDecodeMetarLight
A metar provided by the airport of Mount Hagen (Papua New Guinea)
fun main ()=
_showconsole;
_fooS
sprintf "type : %s\ncode station : %s\nday : %s\ntime : %s:%s\nwind direction : %s\nwind speed : %s\nwind gust : %s\nwind unit : %s\nvariation wind direction : %s - %s\nvisibility : %s\ncurrent weather : %s\nnebulosity : %s - %s - %s\ntemperature : %s\ndewpoint : %s\npresure : %s\nrecent weather : %s"
_scienceWeatherDecodeMetar
"AYMH 190600Z 18008KT 9999 BKN035 23/16 Q1017"
nil;
0;;
The console displays this :
type :
code station : AYMH
day : 19
time : 06:00
wind direction : 180
wind speed : 08
wind gust :
wind unit : KT
variation wind direction : -
visibility : 9999
current weather :
nebulosity : BKN035 - -
temperature : 23
dewpoint : 16
presure : 1017
recent weather :
The NOAA (National Oceanic and Atmospheric Administration, an US department)
provides METARs on its ftp server :
ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/ but you can use an other source. In this last case, don't use the flag FROM_NOAA.
To search an ICAO code (airports, stations, ...) you could search in http://weather.rap.ucar.edu/surface/stations.txt or use your favorite search web engine.