1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
NAME
metar - Trivial weather report
SYNOPSIS
metar get
metar print
metar set STATION
metar list [PREFIX]
metar closest [LATITUDE LONGITUDE] [LIST]
DESCRIPTION
metar is a simple utility for find whether stations (hence referred to
as METAR stations,) and get METAR reports. Most METAR stations are
airports.
ACTIONS
get
Gets the most recent weather report from the selected METAR
station. The first line in the report will contain the station's
name, country, ICAO station identifier, and location. There are
however some station there this information is missing.
print
Print the ICAO station identifier of the selected METAR station,
the station from which weather reports are retrieved. This is
equivalent to running
(cat ~/.config/metar || cat /etc/metar) 2> /dev/null | head -n 1
set STATION
Stores the STATION as the METAR station from which weather
reports shall be retrieved. STATION shall be the stations's
ICAO station identifier. This is equivalent to running
echo STATION > ~/.config/metar
list [PREFIX]
Print all METAR stations. This can take a very long time. You
are strongly encouraged to store the output to a file. For a,
not as good, list you can look at
http://www.aviationweather.gov/static/adds/metars/stations.txt
To speed up the listing process, you can filter the output
by select the PREFIX of the ICAO station identifiers. If you
look at the page with the URL above, you will find the prefix
for your country. PREFIX may be a regular expression. These
regular expressions are listed in
<https://github.com/maandree/metar/blob/master/prefixes>.
Note however, this list is not guaranteed to be up to date.
Each station is will be printed on a line, containing the its
name, country, ICAO station identifier, and location. The
ICAO station identifier is in parenthesis.
closest [LATITUDE LONGITUDE] [LIST]
Given a LATITUDE and LONGITUDE in decimal format, print the
ICAO station identifier of the closest METAR station. If you
have already created a list of all stations using the action
list, specify the filename of that list as the LIST argument.
If LATITUDE and LONGITUDE are omitted, ~/.config/geolocation,
or /etc/geolocation, is used.
FILES
~/.config/metar
Contains the ICAO station identifier for the selected weather
station, and nothing else, except an LF at the end. This will
never change. Other programs are encouraged to use this file
too.
If the file contains more than one line, only the first line,
even if it is empty, is used.
/etc/metar
Fallback file use if ~/.config/metar is missing. Other
programs are encouraged to use this file too.
~/config/geolocation
Used to get your location in case 'metar closest' is invoked
without LATITUDE and LONGITUDE. This file contains your
geographical location using the Global Positioning System in
decimal format. This will never change. Other programs are
encouraged to use this file too.
If the file contains more than one line, only the first line,
even if it is empty, is used.
/etc/geolocation
Fallback file use if ~/.config/geolocation is missing. Other
programs are encouraged to use this file too.
NOTES
US Americans, remember, you are on the Western Hemisphere. Therefore,
you should specify a negative longitude when using the action closest.
SEE ALSO
xpybar(1), localeme(1)
|