| 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 | gettodo "1"
|
|---|
| 39 | sequence=${primaries[0]}
|
|---|
| 40 | cereskey=${primaries[1]}
|
|---|
| 41 |
|
|---|
| 42 | # lock sequ for cal
|
|---|
| 43 | lockfile=$lockpath/lock-$step-$sequence-$cereskey.txt
|
|---|
| 44 | checklock
|
|---|
| 45 |
|
|---|
| 46 | cd $mars
|
|---|
| 47 |
|
|---|
| 48 | # run calibration for sequence
|
|---|
| 49 | printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey"
|
|---|
| 50 |
|
|---|
| 51 | # define files and paths
|
|---|
| 52 | sequfile="$mcsequpath/`printf %08d $sequence | cut -c 1-4`/sequence`printf %08d $sequence`.txt"
|
|---|
| 53 | outpath=$mcpath/$program/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
|---|
| 54 | makedir $outpath
|
|---|
| 55 | log=$outpath/$program`printf %08d $sequence`
|
|---|
| 56 | inpath=$mcpath/callisto/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
|
|---|
| 57 |
|
|---|
| 58 | setstatus "start"
|
|---|
| 59 |
|
|---|
| 60 | command="./star -b -q -v4 -f --ind=$inpath --out=$outpath --log=$log.log --html=$log.html $sequfile"
|
|---|
| 61 | printprocesslog "INFO executing "$command
|
|---|
| 62 | $command
|
|---|
| 63 | check1=$?
|
|---|
| 64 |
|
|---|
| 65 | case $check1 in
|
|---|
| 66 | 0) printprocesslog "INFO $program finished successfully for sequence $sequence cereskey $cereskey (return code $check1)"
|
|---|
| 67 | ;;
|
|---|
| 68 | *) printprocesslog "ERROR $program failed for sequence $sequence cereskey $cereskey (return code $check1)"
|
|---|
| 69 | check=$check1
|
|---|
| 70 | ;;
|
|---|
| 71 | esac
|
|---|
| 72 |
|
|---|
| 73 | setstatus "stop"
|
|---|
| 74 |
|
|---|
| 75 | finish
|
|---|
| 76 |
|
|---|