Jpp  19.1.0
the software that should make you happy
JFremantle.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 0
12 set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13 set_variable: THREADS ACOUSTICS_THREADS 5
14 
15 if do_usage $*; then
16  usage "$script <detector file> (input file)+ <output file>"\
17  "\nAuxiliary script to process acoustic data for dynamic position calibration."\
18  "\nInput files correspond to the output of JAcousticsEventBuilder[.sh]."
19 fi
20 
21 if (( $# < 3 )); then
22  fatal "Wrong number of arguments."
23 fi
24 
25 set_variable DETECTOR $argv[1]
26 set_array INPUT_FILES $argv[2,-2]
27 set_variable OUTPUT_FILE $argv[-1]
28 
29 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
30 
31 JAcoustics.sh $DETECTOR_ID
32 
33 CHECK_EXIT_CODE
34 
35 timer_start
36 
37 {{ JFremantle \
38  -a $DETECTOR \
39  -f "$INPUT_FILES[*]" \
40  -o $OUTPUT_FILE \
41  -T $WORKDIR/tripod.txt \
42  -Y $WORKDIR/transmitter.txt \
43  -V $WORKDIR/sound_velocity.txt \
44  -M $WORKDIR/mechanics.txt \
45  -@ $WORKDIR/acoustics_fit_parameters.txt \
46  -! $WORKDIR/disable.txt \
47  -N $THREADS \
48  -d $DEBUG 3>&1 1>&4 } | read RESULT } 4>&1
49 
50 timer_stop
51 timer_print
52 
53 echo "Result <$RESULT>"