source: trunk/Mars/datacenter/scripts/runstar_mc@ 17828

Last change on this file since 17828 was 10041, checked in by Daniela Dorner, 14 years ago
lock in db instead of lockfile
  • Property svn:executable set to *
File size: 2.7 KB
Line 
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
30source `dirname $0`/sourcefile
31printprocesslog "INFO starting $0"
32program=star
33step=Star
34
35set -C
36
37# get sequence #
38numchanged=0
39while (( 0 < 21 ))
40do
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"
59done
60
61cd $mars
62
63# run calibration for sequence
64
65# define files and paths
66sequfile="$mcsequpath/`printf %08d $sequence | cut -c 1-4`/sequence`printf %08d $sequence`.txt"
67outpath=$mcpath/$program/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
68makedir $outpath
69log=$outpath/$program`printf %08d $sequence`
70inpath=$mcpath/callisto/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
71
72command="./star -b -q -v4 -f --ind=$inpath --out=$outpath --log=$log.log --html=$log.html $sequfile"
73printprocesslog "INFO executing "$command
74$command
75check1=$?
76
77case $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 ;;
83esac
84
85setstatus "stop"
86
87finish
88
Note: See TracBrowser for help on using the repository browser.