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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
.TH METAR 1 METAR
.SH "NAME"
metar - Trivial weather report
.SH "SYNOPSIS"
.B metar
get
.br
.B metar
print
.br
.B metar
set
.I STATION
.br
.B metar
list
.RI [ PREFIX ]
.br
.B metar
closest
.RI [ LATITUDE
.IR LONGITUDE ]
.RI [ LIST ]
.SH "DESCRIPTION"
.B metar
is a simple utility for find whether stations (hence referred to
as METAR stations,) and get METAR reports. Most METAR stations are
airports.
.SH "ACTIONS"
.TP
.B 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.
.TP
.B print
Print the ICAO station identifier of the selected METAR station,
the station from which weather reports are retrieved. This is
equivalent to running
.nf
(cat ~/.config/metar || cat /etc/metar) 2> /dev/null | head -n 1
.fi
.TP
\fBset\fP \fISTATION\fP
Stores the
.I STATION
as the METAR station from which weather reports shall be retrieved.
.I STATION
shall be the stations's ICAO station identifier. This is equivalent
to running
.nf
echo STATION > ~/.config/metar
.fi
.TP
\fBlist\fP [\fIPREFIX\fP]
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
.I PREFIX
of the ICAO station identifiers. If you look at the page with
the URL above, you will find the prefix for your country.
.I 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.
.TP
\fBclosest\fP [\fILATITUDE\fP \fILONGITUDE\fP] [\fILIST\fP]
Given a
.I LATITUDE
and
.I 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
.I LIST
argument. If
.I LATITUDE
and
.I LONGITUDE
are omitted, ~/.config/geolocation, or /etc/geolocation,
is used.
.SH "FILES"
.TP
~/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.
.TP
/etc/metar
Fallback file use if ~/.config/metar is missing. Other
programs are encouraged to use this file too.
.TP
~/.config/geolocation
Used to get your location in case
.B metar closest
is invoked without
.I LATITUDE
annd
.IR 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.
.TP
/etc/geolocation
Fallback file use if ~/.config/geolocation is missing. Other
programs are encouraged to use this file too.
.SH "NOTES"
US Americans, remember, you are on the Western Hemisphere. Therefore,
you should specify a negative longitude when using the action
.BR closest .
.\" This confusion (only from US Americans, and other Americans) is
.\" probably the number one issue reported to Redshift.
.SH "SEE ALSO"
.BR xpybar (1),
.BR localeme (1)
.SH "LICENSE"
Copyright \(co 2016 Mattias Andrée
.br
License GPLv3+: GNU GPL version 3 or later <http://\:gnu.org/\:licenses/\:gpl.html>.
.br
This is free software: you are free to change and redistribute it.
.br
There is NO WARRANTY, to the extent permitted by law.
.SH "BUGS"
Please report bugs to <https://\:github.com/\:maandree/\:metar/\:issues>
or to <maandree@member.fsf.org>.
|