Jpp  master_rocky-43-ge265d140c
the software that should make you happy
sound-velocity.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 WORKDIR ${TMPDIR:-/tmp}/
12 set_variable DETECTOR 49
13 set_variable: FORMAT GRAPHICS_FORMAT gif
14 set_variable+ BATCH GRAPHICS_BATCH -B
15 
16 if do_usage $*; then
17  usage "$script <input file>"\
18  "\nExample input file https://git.km3net.de/calibration/input_tables/-/blob/master/data/sound/SV_Profile_ORCA_250120.txt"
19 fi
20 
21 if (( $# != 1 )); then
22  fatal "Wrong number of arguments."
23 fi
24 
25 DIR=`pwd`
26 
27 cd $WORKDIR
28 
29 rm -f $WORKDIR/sound_velocity.txt
30 
31 JAcoustics.sh $DETECTOR
32 
33 tail -1 sound_velocity.txt | read A B DEPTH
34 
35 cd $DIR
36 
37 echo $A $B $DEPTH
38 
39 JF1 \
40  -F "$A - 1.0 * $B * (x + $DEPTH)" \
41  -x "2000 2600" \
42  -o $WORKDIR/f1.root
43 
44 JGraph -f $1 -o $WORKDIR/graph.root
45 
46 JPlot1D \
47  -f $WORKDIR/graph.root:\.\* \
48  -f $WORKDIR/f1.root:\.\* \
49  -> "D [m]" \
50  -\^ "V [m/s]" \
51  -T "" \
52  -o sound-velocity.$FORMAT $BATCH