-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompressCARE
More file actions
executable file
·99 lines (85 loc) · 2.35 KB
/
compressCARE
File metadata and controls
executable file
·99 lines (85 loc) · 2.35 KB
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
#!/bin/bash
set -o errexit # abort on nonzero exitstatus
set -o pipefail # don't hide errors within pipes
SECONDS=0
echo "Starting compressCARE"
show_help() {
echo ""
echo "Syntax: ./compressCARE [ -arg value ]"
echo "Options:"
echo "-src (source directory)"
echo "-zenith (zenith angle)"
echo "-wobble (wobble)"
echo "-atm (summer/62 or winter/61)"
echo "-nsb (list of NSB levels)"
echo "-mode (std or rhv)"
echo "-n_merge (number to label the split)"
echo ""
}
atm=""
zenith=""
wobble=""
mode="std"
nsb=""
n_merge=""
while :; do
case $1 in
-h|-\?|--help)
show_help
exit
;;
-src)
source_dir=$2
shift
;;
-zenith)
zenith=$2
shift
;;
-wobble)
wobble=$2
shift
;;
-atm)
atm=$2
shift
;;
-nsb)
nsb=$2
shift
;;
-mode)
mode=$2
shift
;;
-n_merge)
n_merge=$2
shift
;;
*)
break
esac
shift
done
echo "Source:${source_dir}"
# shellcheck disable=SC1091,SC1090
source "${source_dir}/util.sh"
# shellcheck disable=SC1091,SC1090
source "${source_dir}/setupMC.sh"
# shellcheck disable=SC1091,SC1090
source "${source_dir}/loadVBF.sh"
# shellcheck disable=SC1091,SC1090
source "${source_dir}/loadRoot.sh"
atm=$(validate_atm "${atm}")
zenith=$(validate_zenith "${zenith}")
wobble=$(validate_wobble "${wobble}")
mode=$(validate_mode "${mode}")
merged_care_file=$(merged_care_file "${zenith}" "${atm}" "${wobble}" "${nsb}" "${mode}" "${n_merge}")
# compressed_care_file=$(compressed_care_file "${zenith}" "${atm}" "${wobble}" "${nsb}" "${mode}")
# merged_dir=$(merged_root_name "${zenith}" "${atm}" "${wobble}" "${nsb}" "${mode}")
# mkdir -p "${merged_dir}"
# mv "${merged_care_file}" "${merged_dir}"
# tar -czvf "${compressed_care_file}" "${merged_dir}"
# bzip2 -z "${merged_care_file}"
zstd -zf "${merged_care_file}"
print_runtime "${SECONDS}"