-
Notifications
You must be signed in to change notification settings - Fork 0
/
composite_workflow.sh
executable file
·44 lines (40 loc) · 1.13 KB
/
composite_workflow.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
#!/bin/bash
usage() {
echo "usage: $0 [-d YYYYMMDD] [-c CF_DIR] [-l LOG_DIR] [-h]"
}
# Input argument defaults
DATE_GLOB='*'
LOG_DIR='.'
CF_DIR='cf'
while getopts ":d:l:c:h" opt; do
case $opt in
d) DATE_GLOB="$OPTARG";;
c) CF_DIR=$OPTARG;;
l) LOG_DIR=$OPTARG;;
h)
usage
exit 0;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1;;
esac
done
echo "### Raw conversion."
trap "exit" INT
for f in ???data/*/*.raw ???data/*/*/*.RAW*; do
raw2cfrad.py -vd -o $CF_DIR "$f" >> $LOG_DIR/raw2cfrad.log 2>> $LOG_DIR/raw2cfrad.err
done
echo "### Adding extra variables."
mlenv.sh var2nc "$CF_DIR/*/cfrad.*.nc" > $LOG_DIR/var2nc.log 2> $LOG_DIR/var2nc.err
echo "### Recover KUM Kdp."
recover_kdp.py -fv $CF_DIR/*/cfrad.*Kum*.nc > $LOG_DIR/recover_kdp.log 2> $LOG_DIR/recover_kdp.err
echo "### Gridding."
gridding.sh $CF_DIR > $LOG_DIR/gridding.log 2> $LOG_DIR/gridding.err
echo "### Compositing."
mkdir -p brancomp
qpe_composite.sh grids > $LOG_DIR/qpe_composite.log 2> $LOG_DIR/qpe_composite.err
echo "### Postprocessing."
compost.py -iptv -o composite brancomp/$DATE_GLOB.mat