Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
sound-velocity.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4if [ -z $JPP_DIR ]; then
5 echo "Variable JPP_DIR undefined."
6 exit
7fi
8
9source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10
11set_variable WORKDIR ${TMPDIR:-/tmp}/
12set_variable DETECTOR 49
13set_variable: FORMAT GRAPHICS_FORMAT gif
14set_variable+ BATCH GRAPHICS_BATCH -B
15
16if 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"
19fi
20
21if (( $# != 1 )); then
22 fatal "Wrong number of arguments."
23fi
24
25DIR=`pwd`
26
27cd $WORKDIR
28
29rm -f $WORKDIR/sound_velocity.txt
30
31JAcoustics.sh $DETECTOR
32
33tail -1 sound_velocity.txt | read A B DEPTH
34
35cd $DIR
36
37echo $A $B $DEPTH
38
39JF1 \
40 -F "$A - 1.0 * $B * (x + $DEPTH)" \
41 -x "2000 2600" \
42 -o $WORKDIR/f1.root
43
44JGraph -f $1 -o $WORKDIR/graph.root
45
46JPlot1D \
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