-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcountCARE
More file actions
executable file
·44 lines (35 loc) · 1.07 KB
/
countCARE
File metadata and controls
executable file
·44 lines (35 loc) · 1.07 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
#!/bin/bash
set -o errexit # abort on nonzero exitstatus
set -o pipefail # don't hide errors within pipes
# shellcheck disable=SC1091,1090
source "util.sh"
atm="winter"
zenith="20"
mode="std"
nsb_group="all"
wobble=""
# shellcheck disable=SC2068
collect_arguments 5 atm zenith mode nsb_group wobble $@
atm=$(validate_atm "${atm}")
zenith=$(validate_zenith "${zenith}")
mode=$(validate_mode "${mode}")
nsb_list=$(nsb_list_from_group "${nsb_group}")
if [ "${wobble}" = "" ]; then
wobble_list="0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0"
else
wobble_list="${wobble}"
fi
run=$(compute_run "${zenith}" "10")
for wobble in ${wobble_list}; do
wob=$(validate_wobble "${wobble}")
printf "\n Wobble %s\n" "${wob}"
for nsb in ${nsb_list}; do
care_file=$(care_file "${run}" "${zenith}" "${atm}" "${wob}" "${nsb}" "${mode}")
care_dir=$(dirname "${care_file}")
if [ -d "${care_dir}" ]; then
# shellcheck disable=SC2012
n=$(ls "${care_dir}" | wc -l)
printf "NSB%s: %s\n" "${nsb}" "$((n / 2))"
fi
done
done