Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
examples/JDB/JCompass.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: DEBUG DATABASE_DEBUG 2
12set_variable: WORKDIR DATABASE_WORKDIR ./
13set_variable DIR $JPP_DIR/examples/JDB/
14set_variable TMAX_S 600.0
15set_variable YMIN 0.00
16set_variable YMAX 0.01
17set_variable FLOOR_RANGE 1 1
18set_variable: FORMAT GRAPHICS_FORMAT gif
19set_variable+ BATCH GRAPHICS_BATCH -B
20
21if do_usage $*; then
22 usage "$script <detector file> (run[-run])+"
23fi
24
25if (( $# > 1 )); then
26 set_variable DETECTOR $argv[1]
27 set_array RUNS $argv[2,-1]
28else
29 fatal "Wrong number of arguments."
30fi
31
32JCookie.sh
33
34eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
35
36typeset -a INPUT_FILES
37
38expand_array RUNS
39
40for RUN in $RUNS[*]; do
41
42 set_variable OUTPUT_FILE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_ahrs.root
43
44 INPUT_FILES+=($OUTPUT_FILE)
45
46 if [[ ! -f $OUTPUT_FILE ]]; then
47
48 JConvertDB \
49 -q ahrs \
50 -@ "detid = `getDetector -D $DETECTOR_ID`" \
51 -@ "minrun = $RUN" \
52 -@ "maxrun = $RUN" \
53 -o $OUTPUT_FILE \
54 -d $DEBUG --!
55 fi
56done
57
58if [[ ! -f ahrs_cal_${DETECTOR_ID}.txt ]]; then
59 JAHRSCalibration -D $DETECTOR_ID -o ahrs_cal_${DETECTOR_ID}.txt --!
60fi
61
62$DIR/JCompass \
63 -f "$INPUT_FILES[*]" \
64 -a $DETECTOR \
65 -o $WORKDIR/ahrs.root \
66 -T $TMAX_S \
67 -c ahrs_cal_${DETECTOR_ID}.txt \
68 -R "$FLOOR_RANGE" \
69 -d $DEBUG --!
70
71JPlot1D \
72 -w 1200x600 \
73 -f $WORKDIR/ahrs.root:G\.\*\\\.orientation \
74 -\^ "orientation [rad]" \
75 -y "-3.20 +3.20" \
76 -N "X 505" \
77 -t "$TIMESTAMP" \
78 -L BR \
79 -T "" \
80 -o $WORKDIR/orientation.$FORMAT $BATCH
81
82JPlot1D \
83 -w 1200x600 \
84 -f $WORKDIR/ahrs.root:G\.\*amplitude \
85 -\^ "amplitude [rad]" \
86 -N "X 505" \
87 -t "$TIMESTAMP" \
88 -L TR \
89 -T "" \
90 -o $WORKDIR/amplitude.$FORMAT $BATCH
91
92JPlot1D \
93 -w 1200x600 \
94 -f $WORKDIR/ahrs.root:G\.\*offset \
95 -\^ "offset [rad]" \
96 -N "X 505" \
97 -t "$TIMESTAMP" \
98 -L TR \
99 -T "" \
100 -o $WORKDIR/offset.$FORMAT $BATCH
101
102JPlot1D \
103 -w 1200x600 \
104 -f $WORKDIR/ahrs.root:G\.\*xorientation \
105 -\^ "xorientation [rad]" \
106 -N "X 505" \
107 -t "$TIMESTAMP" \
108 -L TR \
109 -T "" \
110 -o $WORKDIR/xorientation.$FORMAT $BATCH