Jpp  15.0.3
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 
11 set_variable: DEBUG ACOUSTICS_DEBUG 2
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 source JAcoustics.sh $DETECTOR_ID
47 
48 
49 if [[ $OPTION == "run" ]]; then
50 
51  for STRING in $STRINGS[*]; do
52  nohup $JPP_DIR/examples/JAcoustics/detector-Zmul+zoom:run.sh $STRING $DETECTOR $INPUT_FILES[*] >& /dev/null &
53  done
54 
55  wait
56 
57  for STRING in $STRINGS[*]; do
58  nohup $JPP_DIR/examples/JAcoustics/module-Z:run.sh $STRING 1-18 $DETECTOR $INPUT_FILES[*] >& /dev/null &
59  done
60 
61  wait
62 
63  #$JPP_DIR/examples/JAcoustics/tripod-3Z:run.sh $DETECTOR $INPUT_FILES[*] >& /dev/null
64 
65  for STRING in $STRINGS[*]; do
66  nohup $JPP_DIR/examples/JAcoustics/detector-XY:run.sh $STRING $DETECTOR $INPUT_FILES[*] >& /dev/null &
67  done
68 
69  wait
70 
71  typeset -A TRIPODS
72 
73  get_tripods tripod.txt TRIPODS
74 
75  for TRIPOD in ${(@k)TRIPODS}; do
76  nohup $JPP_DIR/examples/JAcoustics/tripod-Z:run.sh $TRIPOD $DETECTOR $INPUT_FILES[*] >& /dev/null &
77  done
78 
79  wait
80 
81  for TRIPOD in ${(@k)TRIPODS}; do
82  nohup $JPP_DIR/examples/JAcoustics/tripod-XY:run.sh $TRIPOD $DETECTOR $INPUT_FILES[*] >& /dev/null &
83  done
84 
85  wait
86 
87 fi
88 
89 if [[ $OPTION == "plot" || "$OPTION" == "fit" ]]; then
90 
91  for STRING in $STRINGS[*]; do
92  $JPP_DIR/examples/JAcoustics/detector-Zmul:${OPTION}.sh $STRING
93  done
94 
95  for STRING in $STRINGS[*]; do
96  $JPP_DIR/examples/JAcoustics/module-Z:${OPTION}.sh $STRING 1-18
97  done
98 
99  #$JPP_DIR/examples/JAcoustics/tripod-3Z:${OPTION}.sh
100 
101  for STRING in $STRINGS[*]; do
102  $JPP_DIR/examples/JAcoustics/detector-XY:${OPTION}.sh $STRING
103  done
104 
105  typeset -A TRIPODS
106 
107  get_tripods tripod.txt TRIPODS
108 
109  for TRIPOD in ${(@k)TRIPODS}; do
110  $JPP_DIR/examples/JAcoustics/tripod-Z:${OPTION}.sh $TRIPOD
111  done
112 
113  for TRIPOD in ${(@k)TRIPODS}; do
114  $JPP_DIR/examples/JAcoustics/tripod-XY:${OPTION}.sh $TRIPOD
115  done
116 
117 fi
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn only modules within the given range of floors are used fi case set_variable RANGE $argv[3]
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
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[*]
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
exit
Definition: JPizza.sh:36
then echo
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:64
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:20
&set_variable TRIPOD
set_variable NUMBER_OF_ITERATIONS set_variable EPSILON cat acoustics_fit_parameters txt<< EOF $CONFIGURATION[*]Nmin=3;sigma_s=100.0e-6;stdev=10.0;mestimator=0;fixStrings=0;EOF for STRING in $STRINGS[*];do#fit stretching and(z) position of given string set_variable DETECTOR_TMP ${TMPDIR:-/tmp}/detector_A.datx JEditDetector-a $DETECTOR-o $DETECTOR_TMP-r $STRING JEditDetector-a $DETECTOR-o $DETECTOR-k $STRING for MUL in 0.005 0.001;do DX_M=0.2 for((N=0;$N< $NUMBER_OF_ITERATIONS;++N));do CHI2[3]=$CHI2[1] fitPositionOfString $STRING Z $DX_M fitStretchingOfString $STRING $MUL if(($CHI2[3]-$CHI2[1]< $EPSILON));then break fi done if(($N >=$NUMBER_OF_ITERATIONS));then printf"warning: reached maximum number of iterations %d - converenge %7.3f\n"$N $(($CHI2[3]-$CHI2[1])) fi done JMergeDetector-a $DETECTOR-a $DETECTOR_TMP-o $DETECTOR rm-f $DETECTOR_TMP JConvertDetectorFormat-a $DETECTOR-o $DETECTOR-r-d 0 > &dev null done
* usage
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:73
then JCalibrateToT a
Definition: JTuneHV.sh:116
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
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
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 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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
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 $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null