1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | source `dirname $0`/../Sourcefile.sh
|
---|
4 | printprocesslog "INFO starting $0"
|
---|
5 |
|
---|
6 | # get date
|
---|
7 | checkstring=`echo $certaindate | grep -E -o '^20[0-9][0-9]\/[01][0-9]\/[0-3][0-9]$'`
|
---|
8 | if [ "$checkstring" = "" ] || [ "$certaindate" = "" ]
|
---|
9 | then
|
---|
10 | echo "Please give the variable certaindate in the correct format (YYYY/MM/DD)"
|
---|
11 | finish
|
---|
12 | else
|
---|
13 | date=$certaindate
|
---|
14 | fi
|
---|
15 |
|
---|
16 | printprocesslog "INFO get list of calibrated files for "$date
|
---|
17 | calfiles=( `find $anapath/callisto/$date -type f -name '*_C.root' 2>/dev/null | sort` )
|
---|
18 | if [ ${#calfiles[@]} -eq 0 ]
|
---|
19 | then
|
---|
20 | printprocesslog "INFO no calibrated files available for "$date
|
---|
21 | finish
|
---|
22 | fi
|
---|
23 | printprocesslog "INFO get list of star files"
|
---|
24 | starfiles=( `find $anapath/star/$date -type f -name '*_I.root' 2>/dev/null | sort` )
|
---|
25 | if [ ${#starfiles[@]} -eq 0 ]
|
---|
26 | then
|
---|
27 | printprocesslog "INFO no star files available "
|
---|
28 | # finish
|
---|
29 | fi
|
---|
30 |
|
---|
31 | echo ${#calfiles[@]}" "${#starfiles[@]}
|
---|
32 | printprocesslog "INFO #cal-files:"${#calfiles[@]}" #star-files:"${#starfiles[@]}
|
---|
33 |
|
---|
34 | if [ ${#starfiles[@]} -lt ${#calfiles[@]} ]
|
---|
35 | then
|
---|
36 | for calfile in ${calfiles[@]}
|
---|
37 | do
|
---|
38 | starfile=`echo $calfile | sed -e 's/callisto/star/' -e 's/_C/_I/'`
|
---|
39 | logfile=`echo $starfile | sed -e 's/_I.root/-images.log/'`
|
---|
40 | if ! ls $starfile >/dev/null 2>&1
|
---|
41 | then
|
---|
42 | echo $starfile" is missing -> reprocess. "
|
---|
43 | outpath=`dirname $starfile`
|
---|
44 | makedir $outpath
|
---|
45 | `dirname $0`/RunStar.sh $logfile $calfile $outpath $starfile &
|
---|
46 | if ! ls $starfile >/dev/null 2>&1
|
---|
47 | then
|
---|
48 | echo " failed: check log "`echo $starfile | sed -e 's/_I.root/-images.log/'`
|
---|
49 | echo " check calfile "$calfile
|
---|
50 | fi
|
---|
51 | echo ""
|
---|
52 | fi
|
---|
53 | done
|
---|
54 | fi
|
---|
55 |
|
---|
56 |
|
---|