Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
acoustics.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4if [ -z $JPP_DIR ]; then
5 echo "Variable JPP_DIR undefined."
6 exit
7fi
8
9source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10
11set_variable: DEBUG ACOUSTICS_DEBUG 2
12#set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13
14if do_usage $*; then
15 usage "$script <detector file> (input file)* <option>"\
16 "\nAuxiliary script to make scans of fixed parameters and plot results."\
17 "\nInput files correspond to the output of JAcousticsEventBuilder[.sh]."\
18 "\nPossible options: run, plot, fit."
19fi
20
21if (( $# < 2 )); then
22 fatal "Wrong number of arguments."
23fi
24
25# global variables
26
27set_variable DETECTOR $argv[1]
28set_variable OPTION $argv[-1]
29
30if [[ $OPTION == "run" ]]; then
31 if (( $# > 2 )); then
32 set_array INPUT_FILES $argv[2,-2]
33 else
34 fatal "Wrong number of arguments."
35 fi
36fi
37
38if [[ $OPTION != "run" && $OPTION != "plot" && $OPTION != "fit" ]]; then
39 fatal "Invalid option $OPTION."
40fi
41
42
43eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
44eval `JPrintDetector -a $DETECTOR -O SUMMARY`
45
46JAcoustics.sh $DETECTOR_ID
47
48source JAcousticsToolkit.sh
49
50
51if [[ $OPTION == "run" ]]; then
52
53 for STRING in $STRINGS[*]; do
54 nohup $JPP_DIR/examples/JAcoustics/detector-Zmul+zoom:run.sh $STRING $DETECTOR $INPUT_FILES[*] >& /dev/null &
55 done
56
57 wait
58
59 for STRING in $STRINGS[*]; do
60 nohup $JPP_DIR/examples/JAcoustics/module-Z:run.sh $STRING 1-18 $DETECTOR $INPUT_FILES[*] >& /dev/null &
61 done
62
63 wait
64
65 #$JPP_DIR/examples/JAcoustics/tripod-3Z:run.sh $DETECTOR $INPUT_FILES[*] >& /dev/null
66
67 for STRING in $STRINGS[*]; do
68 nohup $JPP_DIR/examples/JAcoustics/detector-XY:run.sh $STRING $DETECTOR $INPUT_FILES[*] >& /dev/null &
69 done
70
71 wait
72
73 typeset -A TRIPODS
74
75 get_tripods tripod.txt TRIPODS
76
77 for TRIPOD in ${(@k)TRIPODS}; do
78 nohup $JPP_DIR/examples/JAcoustics/tripod-Z:run.sh $TRIPOD $DETECTOR $INPUT_FILES[*] >& /dev/null &
79 done
80
81 wait
82
83 for TRIPOD in ${(@k)TRIPODS}; do
84 nohup $JPP_DIR/examples/JAcoustics/tripod-XY:run.sh $TRIPOD $DETECTOR $INPUT_FILES[*] >& /dev/null &
85 done
86
87 wait
88
89fi
90
91if [[ $OPTION == "plot" || "$OPTION" == "fit" ]]; then
92
93 for STRING in $STRINGS[*]; do
94 $JPP_DIR/examples/JAcoustics/detector-Zmul:${OPTION}.sh $STRING
95 done
96
97 for STRING in $STRINGS[*]; do
98 $JPP_DIR/examples/JAcoustics/module-Z:${OPTION}.sh $STRING 1-18
99 done
100
101 #$JPP_DIR/examples/JAcoustics/tripod-3Z:${OPTION}.sh
102
103 for STRING in $STRINGS[*]; do
104 $JPP_DIR/examples/JAcoustics/detector-XY:${OPTION}.sh $STRING
105 done
106
107 typeset -A TRIPODS
108
109 get_tripods tripod.txt TRIPODS
110
111 for TRIPOD in ${(@k)TRIPODS}; do
112 $JPP_DIR/examples/JAcoustics/tripod-Z:${OPTION}.sh $TRIPOD
113 done
114
115 for TRIPOD in ${(@k)TRIPODS}; do
116 $JPP_DIR/examples/JAcoustics/tripod-XY:${OPTION}.sh $TRIPOD
117 done
118
119fi