-
Notifications
You must be signed in to change notification settings - Fork 1
/
weatherwrapper.sh
65 lines (48 loc) · 1.69 KB
/
weatherwrapper.sh
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
#!/bin/bash
# it is important for the above line to be bash and not sh
set -e
. ~/venv/eht-met-forecast/bin/activate
cd ~/github/eht-met-forecast
# die early if this isn't present or somehow won't start
export AM=./am-12.2/src/am
# -bash: -v: command not found
$AM -v > /dev/null || exit 1
export GFS=$(python scripts/print-gfs-cycle.py)
. config-nonobs.sh
#. config-2024.sh
date -u
# this will do nothing if the past was already downloaded with wait
echo downloading in the past
bash do-all.sh
#exit 0 # only download in the past, no plots
echo doing plots in the past, if any
bash do-plots.sh
bash do-deploy.sh
exit 0 # only download in the past, past plots
date -u
# the rest of the script is for when we are observing
# incremental download, slack notifications
if echo $GFS | grep -q 12:00:00; then
python scripts/slack-post.py eht ehtobs_bots "1200UT weather download starting, should finish around 1720UT"
DEST=~/github/eht-met-data
WATCHFILE=$DEST/Aa/$GFS
python scripts/download-watcher.py $WATCHFILE &
jobs -l
disown -a
jobs -l
fi
echo downloading latest with wait
FLUSH="--flush Aa" WAIT=--wait bash do-all.sh
if echo $GFS | grep -q 12:00:00; then
python scripts/slack-post.py eht ehtobs_bots "1200UT weather download finished, charts in another 30 minutes"
fi
echo doing plots
bash do-plots.sh
bash do-deploy.sh
if echo $GFS | grep -q 06:00:00; then
python scripts/slack-post.py eht ehtobs_bots "<https://wiki.ehtcc.org/~glindahl/eht-met-plots/latest/|0600UT weather charts are available>"
fi
if echo $GFS | grep -q 12:00:00; then
python scripts/slack-post.py eht ehtobs_bots "<https://wiki.ehtcc.org/~glindahl/eht-met-plots/latest/|1200UT weather charts are available>"
fi
date -u