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