Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D1ARCA030.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4# --------------------------------------------------------------------------------------------
5#
6# Steering script for the global-fit-of-global-fits procedure of the D1ARCA030 (267) detector.
7#
8# --------------------------------------------------------------------------------------------
9#
10# The start geometry is from D0ARCA030 version 1.1.3. The different
11# files are expected to be in the $DIR directory, provided as command
12# line argument to the script. Then can be recovered from the git
13# archive with the following commands:
14#
15# git clone git@git.km3net.de:auxiliary_data/calibration.git
16# getFile.sh calibration/ 232 1 detector G_DOM_1.1.3 detector
17# getFile.sh calibration/ 232 1 tripod D_1.1.3 tripod
18
19
20if [ -z $JPP_DIR ]; then
21 echo "Variable JPP_DIR undefined."
22 exit
23fi
24
25source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
26
27set_variable DETECTOR_ID 267
28set_array RUNS 24523-24538
29set_variable: MUL ACOUSTICS_MUL -1.21e-2
30set_variable: THREADS ACOUSTICS_THREADS 16
31set_variable SINGULARITY -
32set_variable WORKDIR `pwd`
33set_variable HOMEDIR $WORKDIR
34
35if do_usage $*; then
36 usage "$script <source directory> [user directory]"\
37 "\nThe source directory corresponds to a pre-calibrated D0ARCA030 detector."\
38 "\nThe user directory should be specified when this script is submitted in a batch queue."
39fi
40
41case $# in
42 2) set_variable HOMEDIR $2;&
43 1) set_variable DIR ${1:a};;
44 *) fatal "Wrong number of arguments."
45esac
46
47source JAcousticsToolkit.sh
48
49# post-calibration of input detector
50
51mkdir -p $WORKDIR/post-calibration
52pushd $WORKDIR/post-calibration
53
54post-calibration_D0ARCA030.sh $DIR
55
56popd
57
58set_variable DETECTOR $WORKDIR/post-calibration/detector.datx
59set_variable TRIPOD $WORKDIR/post-calibration/tripod.txt
60set_variable DETECTOR_INITIAL detector_initial.datx
61set_variable TRIPOD_ABSOLUTE tripod_absolute.txt
62expand_array RUNS
63
64# Run in HOMEDIR
65
66mkdir -p $HOMEDIR
67cd $HOMEDIR
68
69cat>$TRIPOD_ABSOLUTE<<EOF
70# TAB6 and TAB1, with there absolute coordinates
71# values corresponding to acoustic emitter position,
72# see https://git.km3net.de/working_groups/calibration/-/issues/124
7322 +587756.91 +4016036.98 -3429.73
7423 +586738.80 +4018233.81 -3452.69
75EOF
76
77# Apply modifications.
78# ID of D1ARCA030 assigned to the calibrated D0ARCA030 detector
79JEditDetector -a $DETECTOR -@ "id=$DETECTOR_ID" -o detector.datx --!
80
81# Copy the initial position of tripods
82cp -p $TRIPOD tripod.txt
83# Remove tripod 20
84JEditTripod -f tripod.txt -o tripod.txt -r 20
85
86# Shift the input geometry 10m up
87SHIFT="0.0 0.0 10.0"
88
89JEditTripod -f tripod.txt -o tripod.txt -T "-1 add $SHIFT"
90JEditDetector -a detector.datx -o detector.datx -M "-1 add $SHIFT"
91
92
93# Add the tripods with absolute positioning
94typeset -A TRIPODS
95get_tripods $TRIPOD_ABSOLUTE TRIPODS; FIXED_TRIPODS=(${(k)TRIPODS[*]})
96
97JEditTripod -f tripod.txt -r "${FIXED_TRIPODS}" -o tripod.txt
98JMergeTripod -f tripod.txt -f $TRIPOD_ABSOLUTE -o tripod.txt
99
100get_tripods tripod.txt TRIPODS; FINAL_TRIPODS=(${(k)TRIPODS[*]})
101
102print "FIXED STRINGS:" $FIXED_STRINGS
103print "FIXED TRIPODS:" $FIXED_TRIPODS
104print "FINAL TRIPODS:" $FINAL_TRIPODS
105
106
107cat>waveform.txt<<EOF
108# Data from D1ARCA030_waveforms.csv
109 28 9
110-29 9
111 25 10
112-26 10
113 29 13
114-30 13
115 34 14
116-35 14
117 49 16
118-50 16
119 23 18
120-24 18
121 39 19
122-40 19
123 47 21
124-48 21
125 41 22
126-42 22
127 43 23
128-44 23
129 40 24
130-41 24
131 44 25
132-45 25
133EOF
134
135cat>acoustics_trigger_parameters.txt<<EOF
136Q = 0.0;
137TMax_s = 0.030;
138numberOfHits = 400;
139EOF
140
141cat>disable.txt<<EOF
142# list of bad transmissions
1439 806649098
1449 806657372
1459 808432849
1469 808454978
1479 808474602
1489 808957378
1499 808958576
1509 808981206
1519 808981369
1529 808987098
1539 816919071
1549 817305565
1559 817595373
1569 817605768
1579 817608140
1589 817802210
15910 806649098
16010 806657372
16110 808430036
16210 808437870
16310 808468365
16410 808474602
16510 808956926
16610 808964876
16710 808974966
16810 808977563
16910 808979220
17010 808984610
17110 808984662
17210 817305565
17310 817569715
17410 817584003
17510 817606460
17610 817608135
17710 817616429
17810 817802231
17910 819737799
18010 819852785
18113 806649098
18213 808430036
18313 808430571
18413 808447081
18513 808454978
18613 808474243
18713 808474602
18813 808480499
18913 808952499
19013 808956926
19113 808964925
19213 808974966
19313 808981369
19413 808984662
19513 817305565
19613 817802231
19718 808447081
19818 808961256
19918 808976232
20018 808976252
20118 808985071
20218 809503404
20318 809521474
20418 817305565
20518 817605238
20619 808956926
20719 808971766
20819 808976207
20919 816929954
21019 817305565
21119 817569715
21221 806476519
21321 808454978
21421 808474243
21521 808961256
21621 808964322
21721 808971305
21821 808979692
21921 808984586
22021 809538805
22121 817300799
22221 817305565
22321 817320316
22421 817565173
22521 817581894
22622 808440691
22722 808454978
22822 808474578
22922 808944706
23022 808956797
23122 808979692
23222 808980070
23322 808981087
23422 808981369
23522 808981913
23622 808982006
23722 808986771
23822 816929999
23922 817300799
24022 817305565
24122 817319884
24222 817597135
24322 817605775
24422 817608140
24522 819762610
246EOF
247
248cat>transmitter.txt<<EOF
249# Data from D1ARCA030_transmitters.csv
25014 5 0 0.74 0.23 0.48
25116 8 0 0.44 0.63 0.48
252EOF
253
254cat>hydrophone.txt<<EOF
255# Data from D0ARCA028_hydrophones.csv
256 9 -1 -0.57 -0.42 0.57
257 10 0 -0.67 0.39 0.62
258 11 0 -0.67 0.39 0.62
259 13 0 -0.68 -0.37 0.62
260 14 0 -0.20 -0.75 0.62
261 12 0 -0.12 0.76 0.62
262 15 0 -0.72 -0.27 0.62
263 19 0 -0.16 -0.76 0.62
264 16 0 0.07 0.77 0.62
265 20 0 0.09 -0.77 0.62
266 23 0 -0.59 -0.49 0.62
267 24 0 -0.68 -0.37 0.62
268 21 0 -0.46 0.62 0.62
269 22 0 -0.26 0.73 0.62
270 25 0 -0.74 -0.22 0.62
271 30 0 -0.08 -0.77 0.62
272 26 0 -0.06 0.77 0.62
273 27 0 -0.21 0.74 0.62
274 28 0 0.12 0.76 0.62
275 32 0 0.47 0.62 0.62
276 5 0 -0.76 -0.13 0.62
277 1 0 -0.20 -0.75 0.62
278 3 0 0.12 -0.76 0.62
279 4 0 0.62 -0.46 0.62
280 8 0 -0.52 -0.57 0.62
281 14 0 -0.20 -0.75 0.62
282 15 0 -0.75 -0.20 0.62
283 17 0 0.08 0.77 0.62
284 18 0 -0.22 -0.74 0.62
285 31 0 0.71 0.31 0.62
286EOF
287
288JAcousticsEventBuilder.sh detector.datx $RUNS[*]
289
290INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
291
292
293# Run in WORKDIR
294
295cd $WORKDIR
296
297if [ ! $HOMEDIR -ef $WORKDIR ]; then
298 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
299 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
300 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
301 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
302fi
303
304cat>script.txt<<EOF
305
306fix tripod $FIXED_TRIPODS[*]
307
308stage 1a 0 2 250.0e-6 10.0 20 1.0 1.0
309stage 2a ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2 0.2
310stage 2c ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2
311stage 3a ${SINGULARITY}2 0 50.0e-6 10.0 10 0.15 0.15
312stage 3c ${SINGULARITY}2 0 50.0e-6 10.0 20 0.3
313
314# initialise
315
316# stage 4a ${SINGULARITY}2 0 50.0e-6 10.0 20 0.2 0.2
317# stage 4c ${SINGULARITY}2 0 50.0e-6 10.0 20 0.2
318EOF
319
320JSydney.sh detector.datx $INPUT_FILES[*] script.txt
321
322#forcing the F0-F1 distance to its nominal value (private comm. with Edward).
323set_variable DETECTOR_FINAL detector.datx
324eval `JPrintDetector -a $DETECTOR_FINAL -O SUMMARY`;
325for STRING in ${STRINGS[*]}; do
326 JEditDetector \
327 -a $DETECTOR_FINAL \
328 -F "$STRING 64.72" \
329 -o $DETECTOR_FINAL --!
330done
331
332if [ ! $HOMEDIR -ef $WORKDIR ]; then
333 cp -vru * $HOMEDIR
334fi
335