1 | #!/bin/sh
|
---|
2 | #
|
---|
3 | # ========================================================================
|
---|
4 | #
|
---|
5 | # *
|
---|
6 | # * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
7 | # * Software. It is distributed to you in the hope that it can be a useful
|
---|
8 | # * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
9 | # * It is distributed WITHOUT ANY WARRANTY.
|
---|
10 | # *
|
---|
11 | # * Permission to use, copy, modify and distribute this software and its
|
---|
12 | # * documentation for any purpose is hereby granted without fee,
|
---|
13 | # * provided that the above copyright notice appear in all copies and
|
---|
14 | # * that both that copyright notice and this permission notice appear
|
---|
15 | # * in supporting documentation. It is provided "as is" without express
|
---|
16 | # * or implied warranty.
|
---|
17 | # *
|
---|
18 | #
|
---|
19 | #
|
---|
20 | # Author(s): Daniela Dorner 07/2010 <mailto:daniela.dorner@unige.ch>
|
---|
21 | # Christian Farnier 07/2010 <mailto:christian.farnier@unige.ch>
|
---|
22 | #
|
---|
23 | # Copyright: MAGIC Software Development, 2000-2010
|
---|
24 | #
|
---|
25 | #
|
---|
26 | # ========================================================================
|
---|
27 | #
|
---|
28 | # This script is launching the calibration of mc sequences.
|
---|
29 | #
|
---|
30 |
|
---|
31 | source `dirname $0`/sourcefile
|
---|
32 | printprocesslog "INFO starting $0"
|
---|
33 | program=callisto
|
---|
34 | step=Callisto
|
---|
35 |
|
---|
36 | set -C
|
---|
37 |
|
---|
38 | # get sequence #
|
---|
39 | gettodo "1"
|
---|
40 | sequence=${primaries[0]}
|
---|
41 | cereskey=${primaries[1]}
|
---|
42 |
|
---|
43 | # lock sequ for cal
|
---|
44 | lockfile=$lockpath/lock-$step-$sequence-$cereskey.txt
|
---|
45 | checklock
|
---|
46 |
|
---|
47 | cd $mars
|
---|
48 |
|
---|
49 | # run calibration for sequence
|
---|
50 | printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey"
|
---|
51 |
|
---|
52 | # define files and paths
|
---|
53 | sequfile="$mcsequpath/`printf %08d $sequence | cut -c 1-4`/sequence`printf %08d $sequence`.txt"
|
---|
54 | outpath=$mcpath/$program/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
---|
55 | makedir $outpath
|
---|
56 | log=$outpath/$program`printf %08d $sequence`
|
---|
57 | callistorc=$setuppath/$program/`printf %03d $cereskey`/callisto.rc
|
---|
58 | inpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
---|
59 |
|
---|
60 | setstatus "start"
|
---|
61 |
|
---|
62 | command="./callisto -b -q -v4 -f --out=$outpath --ind=$inpath --log=$log.log --html=$log.html --config=$callistorc $sequfile"
|
---|
63 | printprocesslog "INFO executing "$command
|
---|
64 | $command
|
---|
65 | check1=$?
|
---|
66 |
|
---|
67 | case $check1 in
|
---|
68 | 0) printprocesslog "INFO $program finished successfully for sequence $sequence cereskey $cereskey (return code $check1)"
|
---|
69 | ;;
|
---|
70 | *) printprocesslog "ERROR $program failed for sequence $sequence cereskey $cereskey (return code $check1)"
|
---|
71 | check=$check1
|
---|
72 | ;;
|
---|
73 | esac
|
---|
74 |
|
---|
75 | setstatus "stop"
|
---|
76 |
|
---|
77 | finish
|
---|
78 |
|
---|