FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-metar/misc/getcycle at main · python-metar/python-metar · GitHub
python-metar
/
python-metar
Public
Notifications
You must be signed in to change notification settings
Fork
125
Star
306
Code
Issues
33
Pull requests
2
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-metar
/
misc
/
getcycle
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
42 lines (36 loc) · 875 Bytes
Breadcrumbs
python-metar
/
misc
/
getcycle
Copy path
File metadata and controls
executable file
·
42 lines (36 loc) · 875 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!
/bin/sh
#
BASE_URL=
"
http://weather.noaa.gov/pub/data/observations/metar/cycles
"
ALL_CYCLES=
"
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
"
usage
() {
echo
"
Usage:
$0
[-a|-all] <cycle> [ <cycle> ... ]
"
exit
1
}
date=
`
date -u
'
+%y%m%d
'
`
hour=
`
date -u
'
+%H
'
`
cycles=
"
"
while
[
"
$#
"
-gt
0 ]
;
do
case
$1
in
-a|-all)
cycles=
$ALL_CYCLES
shift
;;
-
*
)
echo
"
unrecognized option:
$1
"
usage;;
[0-9]
*
)
cycles=
"
$cycles
$1
"
shift
;;
esac
done
if
[
-z
"
$cycles
"
]
;
then
usage
fi
for
name
in
$cycles
;
do
if
[
"
$name
"
-lt
"
$hour
"
]
;
then
file=
"
${date}
-
${name}
Z.TXT
"
else
file=
"
${date}
Y-
${name}
Z.TXT
"
fi
echo
"
Downloading observations for cycle
$name
into
$file
"
curl -s -S -R
"
$BASE_URL
/
${name}
Z.TXT
"
|
grep
"
^[A-Z]
"
>
"
$file
"
done
Back
|
FazBrowse Home
|
New Git URL