source: trunk/DataCheck/Processing/RunStar.sh@ 19975

Last change on this file since 19975 was 18765, checked in by Daniela Dorner, 8 years ago
addapted to new way of submitting jobs in JobManager
  • Property svn:executable set to *
File size: 2.8 KB
Line 
1#!/bin/bash
2#
3
4source `dirname $0`/../Sourcefile.sh
5printprocesslog "INFO starting $0"
6program=RunStar
7step=Star
8
9set -C
10
11# get night and seqid
12if [ "$night" = "" ] && [ "$seqid" = "" ]
13then
14 # if no number are provided by JobManager
15 for (( i=0; i<100; i++ ))
16 do
17 # avoid too many simultaneous queries
18 sleep $(( ( RANDOM % 10 ) + 1 ))
19 # get todo list
20 gettodo "1"
21 echo ${primaries[@]}
22
23 # get all needed variables
24 night=${primaries[0]}
25 seqid=${primaries[1]}
26 nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8`
27 seqnum=$night"_"`printf %03d $seqid`
28
29 # check if script is already running
30 lockfile=$lockpath"/lock-"$program"-"$seqnum".txt"
31 checklock continue
32 printprocesslog "INFO got todo with try #"$i
33 break
34 done
35else
36 nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8`
37 seqnum=$night"_"`printf %03d $seqid`
38 # check if script is already running
39 lockfile=$lockpath"/lock-"$program"-"$seqnum".txt"
40 checklock
41 s=0
42 primaries=( $night $seqid )
43fi
44
45# get all needed paths and files
46seqfile=$seqpath"/"$nightpath"/"$seqnum".seq"
47inpath=$datapath"/callisto/"$nightpath
48outpath=$datapath"/star/"$nightpath
49makedir $outpath
50logfile=$outpath"/"$seqnum"-images.log"
51
52cd $mars
53
54# set status in DB
55# maybe already done in JobManager
56# but do it again to have real runtime
57setstatus "start"
58
59# run star
60printprocesslog "INFO starting star.C for sequence "$seqnum
61
62#check1=`root -q -b fact/star.C\("\"$seqfile\""\,7.5\,3.9\,"\"$inpath\""\,"\"$outpath\""\) | tee $logfile | intgrep`
63# new cleaning levels starting from version 2012.06.22
64#check1=`root -q -b fact/analysis/star.C\("\"$seqfile\""\,4.0\,2.5\,"\"$inpath\""\,"\"$outpath\""\) | tee $logfile | intgrep`
65# new cleaning levels for the new calibration
66#check1=`root -q -b fact/analysis/star.C\("\"$seqfile\""\,5.2\,3.3\,"\"$inpath\""\,"\"$outpath\""\) | tee $logfile | intgrep`
67# new cleaning
68check1=`root -q -b fact/analysis/star.C\("\"$seqfile\""\,"\"$inpath\""\,"\"$outpath\""\) | tee $logfile | intgrep`
69
70case $check1 in
71 0) printprocesslog "INFO star was successful for sequence "$seqnum" (check1=$check1)"
72 ;;
73 *) printprocesslog "ERROR star.C failed for sequence "$seqnum" (check1=$check1)"
74 check=$check1
75 ;;
76esac
77
78# run merpp
79printprocesslog "INFO starting merpp3.C for sequence "$seqnum
80logfile=$outpath"/"$seqnum"-merpp.log"
81
82check1=`root -q -b fact/analysis/merpp.C\("\"$seqfile\""\,"\"$outpath\""\) | tee $logfile | intgrep`
83
84case $check1 in
85 0) printprocesslog "INFO merpp was successful for sequence "$seqnum" (check1=$check1)"
86 ;;
87 *) printprocesslog "ERROR merpp.C failed for sequence "$seqnum" (check1=$check1)"
88 check=10$check1
89 ;;
90esac
91
92setstatus "stop"
93
94finish
95
Note: See TracBrowser for help on using the repository browser.