Changeset 15401 for trunk/DataCheck


Ignore:
Timestamp:
04/21/13 01:51:13 (12 years ago)
Author:
Daniela Dorner
Message:
implemented plots for last week and run only for last night during the night
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/QuickLook/Step3.sh

    r15390 r15401  
    3232fi
    3333
    34 # get last 3, 6 or 9 nights
    35 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
    36 #        `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
    37 #        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
    38         )
    39 #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
     34# get current hour
     35hour=`date +%k`
     36if [ $hour -le 7 ] || [ $hour -ge 19 ]
     37then
     38   dates=( `date +%Y/%m/%d --date="-12hour"` )
     39else
     40   # get last 3, 6 or 9 nights
     41   dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
     42   #        `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
     43   #        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
     44           )
     45fi
     46dates=( `find -L $auxdata -mindepth 3 -type d | sort -r | sed "s/\${auxdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
    4047
    41 dates=( "2013/04/19" )
     48#dates=( "2013/04/19" )
    4249
    4350# source info on daq in /loc_data/analysis/sources.txt
     
    4653timebins=( 5 10 20 30 40 60 90 120 180 240 300 360 )
    4754
     55echo ${dates[@]}
    4856for date in ${dates[@]}
    4957do
     
    5159   query="SELECT fSourceKEY FROM RunInfo WHERE fNight="$date2" AND fSourceKey > 0 AND fRunTypeKEY=1 GROUP BY fSourceKey "
    5260   sources=( `sendquery` )
     61   echo "process "$date" -> sources: "${sources[@]}
    5362   for source in ${sources[@]}
    5463   do
     
    7584                 ;;
    7685            *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" night "$date2" (check1=$check1)"
     86                 ;;
     87         esac
     88
     89         
     90         # doing the plots for last week
     91         lastweek=`date +%Y%m%d --date="$date -1 week"`
     92         logfile=$outpath"/lightcurve"$source"_"$timebin"min_week.log"
     93         outfile=$outpath"/lightcurve"$source"_"$timebin"min_week.root"
     94         echo $outfile
     95         printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" night "$date2" last week ("$lastweek")"
     96     
     97         check1=`root -q -b $mars2/fact/analysis/lightcurve.C+\($source\,$lastweek\\,$date2\,$timebin\,"\"$resulttable1"\"\,"\"$outfile\""\) | tee $logfile | intgrep`
     98     
     99         case $check1 in
     100            0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" last week (check1=$check1)"
     101                 ./showplot -b --save-as-png $outfile
     102                 ;;
     103            1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" last week, but nothing to plot (check1=$check1)"
     104                 ;;
     105            *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" night "$date2" last week (check1=$check1)"
    77106                 ;;
    78107         esac
Note: See TracChangeset for help on using the changeset viewer.