| 1 | #!/bin/bash
|
|---|
| 2 | #
|
|---|
| 3 |
|
|---|
| 4 | source `dirname $0`/../Sourcefile.sh
|
|---|
| 5 | printprocesslog "INFO starting $0"
|
|---|
| 6 | program=RunStar
|
|---|
| 7 | step=Star
|
|---|
| 8 |
|
|---|
| 9 | set -C
|
|---|
| 10 |
|
|---|
| 11 | for (( i=0; i<100; i++ ))
|
|---|
| 12 | do
|
|---|
| 13 | # get todo list
|
|---|
| 14 | gettodo "1"
|
|---|
| 15 |
|
|---|
| 16 | # get all needed variables
|
|---|
| 17 | night=${primaries[0]}
|
|---|
| 18 | seqid=${primaries[1]}
|
|---|
| 19 | nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8`
|
|---|
| 20 | seqnum=$night"_"`printf %03d $seqid`
|
|---|
| 21 |
|
|---|
| 22 | # check if script is already running
|
|---|
| 23 | lockfile=$lockpath"/lock-"$program"-"$seqnum".txt"
|
|---|
| 24 | checklock continue
|
|---|
| 25 | printprocesslog "INFO got todo with try #"$i
|
|---|
| 26 | break
|
|---|
| 27 | done
|
|---|
| 28 |
|
|---|
| 29 | # get all needed paths and files
|
|---|
| 30 | seqfile=$seqpath"/"$nightpath"/"$seqnum".seq"
|
|---|
| 31 | inpath=$datapath"/callisto/"$nightpath
|
|---|
| 32 | outpath=$datapath"/star/"$nightpath
|
|---|
| 33 | makedir $outpath
|
|---|
| 34 | logfile=$outpath"/"$seqnum"-images.log"
|
|---|
| 35 |
|
|---|
| 36 | cd $mars
|
|---|
| 37 |
|
|---|
| 38 | # run star
|
|---|
| 39 | printprocesslog "INFO starting star.C for sequence "$seqnum
|
|---|
| 40 | setstatus "start"
|
|---|
| 41 |
|
|---|
| 42 | check1=`root -q -b fact/star.C\("\"$seqfile\""\,7.5\,3.9\,"\"$inpath\""\,"\"$outpath\""\) | tee $logfile | intgrep`
|
|---|
| 43 |
|
|---|
| 44 | case $check1 in
|
|---|
| 45 | 0) printprocesslog "INFO star was successful for sequence "$seqnum" (check1=$check1)"
|
|---|
| 46 | ;;
|
|---|
| 47 | *) printprocesslog "ERROR star.C failed for sequence "$seqnum" (check1=$check1)"
|
|---|
| 48 | check=$check1
|
|---|
| 49 | ;;
|
|---|
| 50 | esac
|
|---|
| 51 |
|
|---|
| 52 | # run merpp
|
|---|
| 53 | printprocesslog "INFO starting merpp3.C for sequence "$seqnum
|
|---|
| 54 | logfile=$outpath"/"$seqnum"-merpp.log"
|
|---|
| 55 |
|
|---|
| 56 | check1=`root -q -b fact/merpp3.C\("\"$seqfile\""\,"\"$outpath\""\) | tee $logfile | intgrep`
|
|---|
| 57 |
|
|---|
| 58 | case $check1 in
|
|---|
| 59 | 0) printprocesslog "INFO merpp was successful for sequence "$seqnum" (check1=$check1)"
|
|---|
| 60 | ;;
|
|---|
| 61 | *) printprocesslog "ERROR merpp3.C failed for sequence "$seqnum" (check1=$check1)"
|
|---|
| 62 | check=10
|
|---|
| 63 | ;;
|
|---|
| 64 | esac
|
|---|
| 65 |
|
|---|
| 66 | setstatus "stop"
|
|---|
| 67 |
|
|---|
| 68 | finish
|
|---|
| 69 |
|
|---|