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 | #
|
---|
22 | # Copyright: MAGIC Software Development, 2000-2010
|
---|
23 | #
|
---|
24 | #
|
---|
25 | # ========================================================================
|
---|
26 | #
|
---|
27 | # This script is launching star for mc sequences.
|
---|
28 | #
|
---|
29 |
|
---|
30 | source `dirname $0`/sourcefile
|
---|
31 | printprocesslog "INFO starting $0"
|
---|
32 | program=star
|
---|
33 | step=Star
|
---|
34 |
|
---|
35 | set -C
|
---|
36 |
|
---|
37 | # get sequence #
|
---|
38 | numchanged=0
|
---|
39 | while (( 0 < 21 ))
|
---|
40 | do
|
---|
41 | if ! [ $numchanged -eq 1 ]
|
---|
42 | then
|
---|
43 | if ! [ "$sequence" = "" ] && ! [ "$cereskey" = "" ]
|
---|
44 | then
|
---|
45 | printprocesslog "INFO $program for sequence $sequence cereskey $cereskey is already running => request new number "
|
---|
46 | fi
|
---|
47 | gettodo "1"
|
---|
48 | sequence=${primaries[0]}
|
---|
49 | cereskey=${primaries[1]}
|
---|
50 | if [ "$sequence" = "" ] || [ "$cereskey" = "" ]
|
---|
51 | then
|
---|
52 | printprocesslog "INFO nothing to do for $program "
|
---|
53 | fi
|
---|
54 | else
|
---|
55 | printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey"
|
---|
56 | break
|
---|
57 | fi
|
---|
58 | setstatus "start"
|
---|
59 | done
|
---|
60 |
|
---|
61 | cd $mars
|
---|
62 |
|
---|
63 | # run calibration for sequence
|
---|
64 |
|
---|
65 | # define files and paths
|
---|
66 | sequfile="$mcsequpath/`printf %08d $sequence | cut -c 1-4`/sequence`printf %08d $sequence`.txt"
|
---|
67 | outpath=$mcpath/$program/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
---|
68 | makedir $outpath
|
---|
69 | log=$outpath/$program`printf %08d $sequence`
|
---|
70 | inpath=$mcpath/callisto/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
---|
71 |
|
---|
72 | command="./star -b -q -v4 -f --ind=$inpath --out=$outpath --log=$log.log --html=$log.html $sequfile"
|
---|
73 | printprocesslog "INFO executing "$command
|
---|
74 | $command
|
---|
75 | check1=$?
|
---|
76 |
|
---|
77 | case $check1 in
|
---|
78 | 0) printprocesslog "INFO $program finished successfully for sequence $sequence cereskey $cereskey (return code $check1)"
|
---|
79 | ;;
|
---|
80 | *) printprocesslog "ERROR $program failed for sequence $sequence cereskey $cereskey (return code $check1)"
|
---|
81 | check=$check1
|
---|
82 | ;;
|
---|
83 | esac
|
---|
84 |
|
---|
85 | setstatus "stop"
|
---|
86 |
|
---|
87 | finish
|
---|
88 |
|
---|