Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D1ORCA013.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4# --------------------------------------------------------------------------------------------
5#
6# Auxiliary script to derive the geometry of the D1ORCA013 (117) detector from other detectors.
7#
8# --------------------------------------------------------------------------------------------
9
10if [ -z $JPP_DIR ]; then
11 echo "Variable JPP_DIR undefined."
12 exit
13fi
14
15source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16
17set_variable DETECTOR_ID 117
18
19if do_usage $*; then
20 usage "$script <source directory A> <source directory B>" \
21 "\nThe source directory A corresponds to a pre-calibrated D0ORCA010 detector." \
22 "\nThe source directory B corresponds to a pre-calibrated D1ORCA011 detector."
23fi
24
25case $# in
26 2) set_variable DIR_DETECTOR_A ${1:a}
27 set_variable DIR_DETECTOR_B ${2:a};;
28 *) fatal "Wrong number of arguments."
29esac
30
31set_variable DETECTOR_A $DIR_DETECTOR_A/detector.datx
32set_variable TRIPOD_A $DIR_DETECTOR_A/tripod.txt
33set_variable DETECTOR_B $DIR_DETECTOR_B/detector.datx
34set_variable TRIPOD_B $DIR_DETECTOR_B/tripod.txt
35
36if [[ ! -f $DETECTOR_A ]]; then
37 fatal "Missing pre-calibrated D0ORCA010 input detector file"
38fi
39
40if [[ ! -f $DETECTOR_B ]]; then
41 fatal "Missing pre-calibrated D1ORCA011 input detector file"
42fi
43
44if [[ ! -f $TRIPOD_B ]]; then
45 fatal "Missing pre-calibrated D1ORCA011 input tripod file"
46fi
47
48# D1ORCA011 detector striped of all the new strings wrt D0ORCA011 and ID of D0ORCA011 assigned
49JEditDetector \
50 -a $DETECTOR_B \
51 -@ "id=$DETECTOR_ID" \
52 -k "1 2 3 4 9 10 12 18 28" \
53 -o detector.datx
54
55# D0ORCA010 detector striped of all strings but the ones in D0ORCA011
56JEditDetector \
57 -a $DETECTOR_A \
58 -k "1 2 3 9 10 11 12 19" \
59 -o detector_tmp.datx
60
61cat >tripod_tmp.txt<<EOF
62EOF
63
64# D0ORCA010 detector aligned with D1ORCA011 at the base level.
65JAlignDetector \
66 -A \
67 -O \
68 -a detector_tmp.datx \
69 -T tripod_tmp.txt \
70 -b detector.datx \
71 -r 0-0
72
73# D0ORCA010 detector striped of all the strings but ORCA.0011
74JEditDetector \
75 -a detector_tmp.datx \
76 -k "11 19" \
77 -o detector_tmp.datx
78
79# The two detector merged
80JMergeDetector \
81 -a detector.datx \
82 -a detector_tmp.datx \
83 -o detector.datx
84
85JEditTripod \
86 -f $TRIPOD_B \
87 -r "6" \
88 -o tripod.txt
89
90rm -f tripod_tmp.txt
91rm -f detector_tmp.datx
92
93
94JMergeDisable \
95 -f $DIR_DETECTOR_A/disable.txt \
96 -f $DIR_DETECTOR_B/disable.txt \
97 -o disable.txt
98
99JEditTransmitter \
100 -f $DIR_DETECTOR_B/transmitter.txt \
101 -k "1 2 3 4 9 10 12 18 28" \
102 -o transmitter.txt
103
104JEditTransmitter \
105 -f $DIR_DETECTOR_A/transmitter.txt \
106 -k "11 19" \
107 -o transmitter_tmp.txt
108
109JMergeTransmitter \
110 -f transmitter.txt \
111 -f transmitter_tmp.txt \
112 -o transmitter.txt
113
114rm -f transmitter_tmp.txt
115
116JEditHydrophone \
117 -f $DIR_DETECTOR_B/hydrophone.txt \
118 -k "1 2 3 4 9 10 12 18 28" \
119 -o hydrophone.txt
120
121JEditHydrophone \
122 -f $DIR_DETECTOR_A/hydrophone.txt \
123 -k "11 19" \
124 -o hydrophone_tmp.txt
125
126JMergeHydrophone \
127 -f hydrophone.txt \
128 -f hydrophone_tmp.txt \
129 -o hydrophone.txt
130
131rm -f hydrophone_tmp.txt
132
133cat>waveform.txt<<EOF
134# waveform identifier; emitter identifier
135 16 3
136-17 3
137 23 5
138-24 5
139EOF