Jpp  master_rocky-40-g5f0272dcd
the software that should make you happy
hydrophone-XY:plot.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 zmodload zsh/mathfunc
12 
13 set_variable: DEBUG ACOUSTICS_DEBUG 2
14 set_variable: WORKDIR ACOUSTICS_WORKDIR ./
15 set_variable: FORMAT GRAPHICS_FORMAT gif
16 set_variable+ BATCH GRAPHICS_BATCH -B
17 
18 if do_usage $*; then
19  usage "$script <string identifier>"
20 fi
21 
22 if (( $# != 1 )); then
23  fatal "Wrong number of arguments."
24 fi
25 
26 set_variable STRING $argv[1]
27 
28 set_variable HYDROPHONE_TXT $WORKDIR/hydrophonexy_${STRING}.txt
29 set_variable HYDROPHONE_ROOT $WORKDIR/hydrophonexy_${STRING}.root
30 
31 if [[ ! -f $HYDROPHONE_TXT ]] then
32  fatal "No hydrophone data file $HYDROPHONE_TXT."
33 fi
34 
35 JGraph2D \
36  -f $HYDROPHONE_TXT \
37  -o $HYDROPHONE_ROOT
38 
39 JPrintHydrophone -f $WORKDIR/hydrophone.txt -S $STRING | read DUMMY FLOOR X Y Z
40 
41 JEllipse -o ${TMPDIR:-/tmp}/ellipse.root -p "0.0 0.0 $((sqrt($X*$X + $Y*$Y)))"
42 
43 echo $X $Y > ${TMPDIR:-/tmp}/graph.txt
44 
45 JGraph \
46  -f ${TMPDIR:-/tmp}/graph.txt \
47  -o ${TMPDIR:-/tmp}/graph.root
48 
49 typeset -Z 4 STRING
50 
51 JPlot2D \
52  -f ${HYDROPHONE_ROOT}:\.\* \
53  -f ${TMPDIR:-/tmp}/ellipse.root:\.\* \
54  -f ${TMPDIR:-/tmp}/graph.root:\.\* \
55  -> "#Deltax [m]" \
56  -< "#Deltay [m]" \
57  -\^ "RMS [ms]" \
58  -N "X 505" \
59  -N "Y 505" \
60  -Z \
61  -O COLZ \
62  -T "[$STRING]" \
63  -o $WORKDIR/hydrophonexy_${STRING}.$FORMAT $BATCH
64 
65 rm -f $HYDROPHONE_ROOT
66 rm -f ${TMPDIR:-/tmp}/ellipse.root
67 rm -f ${TMPDIR:-/tmp}/graph.{txt,root}
68 
69