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

Last change on this file since 15144 was 15067, checked in by Daniela Dorner, 12 years ago
added (script to fill ratescan info to db)
  • Property svn:executable set to *
File size: 1.8 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"/FillTemp-"$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
34 # check if aux files are available from that night
35 if ! [ -d $auxdir ]
36 then
37 printprocesslog "INFO no data available in "$auxdir
38 continue
39 else
40 printprocesslog "INFO processing files in "$auxdir
41 fi
42
43 ratescanfile=$auxdir/$runnumber.RATE_SCAN_DATA.fits
44 if ! [ -e $ratescanfile ]
45 then
46 printprocesslog "WARN "$ratescanfile" not found."
47 continue
48 else
49 ratescannumerrors=`fverify $ratescanfile 2>/dev/null | grep -o '[0-9][ ]error(s)' | grep -E -o '[0-9]'`
50 if [ $ratescannumerrors -gt 0 ]
51 then
52 printprocesslog "WARN for $ratescanfile fverify returned "$ratescannumerrors" error(s)."
53 fi
54 fi
55
56 echo "run fillratescan.C for night "$runnumber
57 root -q -b -l fact/fillratescan.C\("\"$ratescanfile"\"\,kFALSE\)
58
59done
60
61finish
62
63
Note: See TracBrowser for help on using the repository browser.