source: trunk/DataCheck/Processing/FillRatescans.sh@ 17054

Last change on this file since 17054 was 15329, checked in by Daniela Dorner, 12 years ago
adapted name of logfile
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3source `dirname $0`/../Sourcefile.sh
4printprocesslog "INFO starting "$0
5
6# setup to use ftools
7source $HEADAS/headas-init.sh
8
9logfile=$runlogpath"/FillRatescan-"$datetime".log"
10date >> $logfile
11
12# get last 3, 6 or 9 nights
13dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
14# `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
15# `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
16 )
17#dates=( `find -L $ziprawdata -mindepth 3 -type d | sort -r | sed "s/\${ziprawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
18
19#dates=( "2013/01/31" )
20
21printprocesslog "INFO processing the following night(s): "${dates[@]}
22echo `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
23
24echo ${dates[@]}
25
26cd $mars
27
28# do filling of aux data
29for date in ${dates[@]}
30do
31 auxdir=$auxdata/$date
32 runnumber=`echo $date | sed -e 's/\///g'`
33 echo $auxdir
34
35 # check if aux files are available from that night
36 if ! [ -d $auxdir ]
37 then
38 printprocesslog "INFO no data available in "$auxdir
39 continue
40 else
41 printprocesslog "INFO processing files in "$auxdir
42 fi
43
44 ratescanfile=$auxdir/$runnumber.RATE_SCAN_DATA.fits
45 ls $ratescanfile
46 if ! [ -e $ratescanfile ]
47 then
48 printprocesslog "WARN "$ratescanfile" not found."
49 continue
50 else
51 ratescannumerrors=`fverify $ratescanfile 2>/dev/null | grep -o '[0-9][ ]error(s)' | grep -E -o '[0-9]'`
52 if [ $ratescannumerrors -gt 0 ]
53 then
54 printprocesslog "WARN for $ratescanfile fverify returned "$ratescannumerrors" error(s)."
55 fi
56 fi
57
58 echo "run fillratescan.C for night "$runnumber
59 root -q -b -l fact/fillratescan.C\("\"$ratescanfile"\"\,kFALSE\)
60
61done
62
63finish
64
65
Note: See TracBrowser for help on using the repository browser.