source: trunk/MagicSoft/Mars/datacenter/scripts/runganymed@ 7938

Last change on this file since 7938 was 7938, checked in by hoehne, 19 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.9 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 08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2006
23#
24#
25# ========================================================================
26#
27# This script is launching ganymed for datasets.
28#
29# In the case of ganymed only one dataset is processed. Despite of
30# that the structure of the script is such, that also more datasets could
31# be processed. The restriction to one dataset has been made, as ganymed
32# takes some time. There's one todo file per dataset.
33# First the script searches for a todo file. Then ganymed is run for the
34# dataset from this todo file.
35#
36# the ganymed.rc files are stored in the setup directory
37#
38
39program=ganymed
40source `dirname $0`/sourcefile
41
42set -C
43
44column=fGanymed
45
46scriptlogpath=$runlogpath/$program
47makedir $scriptlogpath
48scriptlog=$scriptlogpath/run$program-$datetime.log
49
50date >> $scriptlog 2>&1
51
52# get dataset #
53gettodo >> $scriptlog 2>&1
54dataset=$process
55
56# lock sequ
57lockfile=$lockpath/lock-$table-$column-$dataset.txt
58checklock >> $scriptlog 2>&1
59
60cd $mars
61
62echo "run $program for dataset $dataset..." >> $scriptlog 2>&1
63no=`printf %08d $dataset | cut -c 0-5`
64no2=`printf %08d $dataset`
65var1=$no
66var2=$no2
67outpath="$datapath/$program/$no/$no2"
68makedir $outpath >> $scriptlog 2>&1
69
70datasetfile="$datasetpath/$no/dataset$no2.txt"
71# get observation mode to choose ganymed.rc file
72wobble=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1
73wobble2=`echo $wobble | grep ^\#` >> $scriptlog 2>&1
74if [ "$wobble2" = "" ]
75then
76 mode="wobble" >> $scriptlog 2>&1
77else
78 mode="onoff" >> $scriptlog 2>&1
79fi
80ganymedrc=$setuppath/ganymed/ganymed_$mode.rc
81
82setstatus "start" >> $scriptlog 2>&1
83
84./ganymed -b -q -v4 -f --ind=$datapath/star --config=$ganymedrc --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --out=$outpath $datasetfile 2>> $scriptlog> /dev/null
85check1=$?
86
87case $check1 in
88 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1 ;;
89 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
90 com=$Fganymed
91 check=$check1
92 ;;
93esac
94
95setstatus "stop" >> $scriptlog 2>&1
96
97finish >> $scriptlog 2>&1
98
Note: See TracBrowser for help on using the repository browser.