| 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 | numchanged=0
|
|---|
| 40 | while (( 0 < 21 ))
|
|---|
| 41 | do
|
|---|
| 42 | if ! [ $numchanged -eq 1 ]
|
|---|
| 43 | then
|
|---|
| 44 | if ! [ "$sequence" = "" ] && ! [ "$cereskey" = "" ]
|
|---|
| 45 | then
|
|---|
| 46 | printprocesslog "INFO $program for sequence $sequence cereskey $cereskey is already running => request new number "
|
|---|
| 47 | fi
|
|---|
| 48 | gettodo "1"
|
|---|
| 49 | sequence=${primaries[0]}
|
|---|
| 50 | cereskey=${primaries[1]}
|
|---|
| 51 | if [ "$sequence" = "" ] || [ "$cereskey" = "" ]
|
|---|
| 52 | then
|
|---|
| 53 | printprocesslog "INFO nothing to do for $program "
|
|---|
| 54 | fi
|
|---|
| 55 | else
|
|---|
| 56 | printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey"
|
|---|
| 57 | break
|
|---|
| 58 | fi
|
|---|
| 59 | setstatus "start"
|
|---|
| 60 | done
|
|---|
| 61 |
|
|---|
| 62 | cd $mars
|
|---|
| 63 |
|
|---|
| 64 | # run calibration for sequence
|
|---|
| 65 |
|
|---|
| 66 | # define files and paths
|
|---|
| 67 | sequfile="$mcsequpath/`printf %08d $sequence | cut -c 1-4`/sequence`printf %08d $sequence`.txt"
|
|---|
| 68 | outpath=$mcpath/$program/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
|---|
| 69 | makedir $outpath
|
|---|
| 70 | log=$outpath/$program`printf %08d $sequence`
|
|---|
| 71 | callistorc=$setuppath/$program/`printf %03d $cereskey`/callisto.rc
|
|---|
| 72 | inpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
|---|
| 73 |
|
|---|
| 74 | command="./callisto -b -q -v4 -f --out=$outpath --ind=$inpath --log=$log.log --html=$log.html --config=$callistorc $sequfile"
|
|---|
| 75 | printprocesslog "INFO executing "$command
|
|---|
| 76 | $command
|
|---|
| 77 | check1=$?
|
|---|
| 78 |
|
|---|
| 79 | case $check1 in
|
|---|
| 80 | 0) printprocesslog "INFO $program finished successfully for sequence $sequence cereskey $cereskey (return code $check1)"
|
|---|
| 81 | ;;
|
|---|
| 82 | *) printprocesslog "ERROR $program failed for sequence $sequence cereskey $cereskey (return code $check1)"
|
|---|
| 83 | check=$check1
|
|---|
| 84 | ;;
|
|---|
| 85 | esac
|
|---|
| 86 |
|
|---|
| 87 | setstatus "stop"
|
|---|
| 88 |
|
|---|
| 89 | finish
|
|---|
| 90 |
|
|---|