Jpp  18.0.1-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
acoustics.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 if [ -z $JPP_DIR ]; then
5  echo "Variable JPP_DIR undefined."
6  exit
7 fi
8 
9 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10 
12 #set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13 
14 if do_usage $*; then
15  usage "$script <detector file> (input file)* <option>"\
16  "\nAuxiliary script to make scans of so-called fixed parameters and plot results."\
17  "\nInput files correspond to the output of JAcousticsEventBuilder[.sh]."\
18  "\nPossible options: run, plot, fit."
19 fi
20 
21 if (( $# < 2 )); then
22  fatal "Wrong number of arguments."
23 fi
24 
25 # global variables
26 
29 
30 if [[ $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
36 fi
37 
38 if [[ $OPTION != "run" && $OPTION != "plot" && $OPTION != "fit" ]]; then
39  fatal "Invalid option $OPTION."
40 fi
41 
42 
43 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
44 eval `JPrintDetector -a $DETECTOR -O SUMMARY`
45 
46 JAcoustics.sh $DETECTOR_ID
47 
48 source JAcousticsToolkit.sh
49 
50 
51 if [[ $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 
89 fi
90 
91 if [[ $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 
119 fi
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
then usage $script< detector identifier >< startdate\"YYYY-MM-DDHH:MM:SS\"><finaldate\"YYYY-MM-DDHH:MM:SS\"><QA/QCfile> fi case set_variable QAQC_TXT $argv[4]
Definition: JDataMonitor.sh:24
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
then usage $script(input file)+< QA/QC file >" "\nAuxiliary script to produce the following QA/QC data then fatal Wrong number of arguments fi set_array INPUT_FILES $argv[1,-2] set_variable QAQC_FILE $argv[-1] mkdir p $WORKDIR set_variable ACOUSTICS_DEBUG
Definition: JQAQC.sh:80
exit
Definition: JPizza.sh:36
do JCanberra a $DETECTOR f $INPUT_FILE o $WORKDIR canberra[${EMITTER}\] root T $WORKDIR tripod txt V $WORKDIR sound_velocity txt M $WORKDIR mechanics txt H $WORKDIR hydrophone txt E $EMITTER $DISABLE d $DEBUG!done kill_child_processes_at_exit attach getModule a $DETECTOR typeset Z STRING typeset Z FLOOR for STRING in $STRINGS[*]
Definition: JCanberra.sh:68
then fatal Invalid string $STRING
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
then JCalibrateToT a
Definition: JTuneHV.sh:116
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG set_variable WORKDIR if do_usage *then usage for INPUT_FILE in $INPUT_FILES[*]
* usage
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:77
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
then echo
Definition: JQAQC.sh:90
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
script
Definition: JAcoustics.sh:2
*fatal Wrong option $OPTION
then fatal Invalid tripod $TRIPOD
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62