- Timestamp:
- 04/20/13 19:32:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/QuickLook/Step3.sh
r15308 r15390 7 7 #source $root 8 8 #factpath=/home/fact/FACT++.in-run-fad-loss 9 export LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH9 #export LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH 10 10 11 mars=/home/fact/Mars 11 12 cd $mars 13 pwd 14 # use macro from different mars version until versions are sorted out 15 mars2=/home/fact/SW.automatic.processing/Mars.svn.2013.04.12 12 16 13 if ! [ "$1" = " min" ] && ! [ "$1" = "nights" ]17 if ! [ "$1" = "run" ] && ! [ "$1" = "night" ] 14 18 then 15 echo "wrong option "$1" (only min and nights valid)." 19 #echo "wrong option "$1" (only min and nights valid)." 20 echo "wrong option "$1" (only run and night valid)." 16 21 finish 17 22 fi 18 23 19 if [ "$1" = " min" ]24 if [ "$1" = "run" ] 20 25 then 21 date=`date --date="-18HOUR" +%Y/%m/%d`26 tablenam=$resulttable1 22 27 fi 23 28 24 #anapath=/loc_data/analysis 29 if [ "$1" = "night" ] 30 then 31 tablenam=$resulttable2 32 fi 33 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 40 41 dates=( "2013/04/19" ) 25 42 26 43 # source info on daq in /loc_data/analysis/sources.txt 27 44 # (dump of DB scheduling.sources) 28 sources=( 1 2 5 7 11 )29 45 30 for source in ${sources[@]} 46 timebins=( 5 10 20 30 40 60 90 120 180 240 300 360 ) 47 48 for date in ${dates[@]} 31 49 do 32 dirs=( `find $anapath/$source/ganymed*$1 -maxdepth 0 -type d 2>/dev/null` ) 33 if [ ${#dirs[@]} -eq 0 ] 34 then 35 printprocesslog "INFO no directories ("$1") found for source "$source 36 continue 37 fi 38 for dir in ${dirs[@]} 50 date2=`echo $date | sed -e 's/\///g'` 51 query="SELECT fSourceKEY FROM RunInfo WHERE fNight="$date2" AND fSourceKey > 0 AND fRunTypeKEY=1 GROUP BY fSourceKey " 52 sources=( `sendquery` ) 53 for source in ${sources[@]} 39 54 do 40 printprocesslog "INFO processing files in "$dir 41 inpath=$dir 42 outpath=`echo $dir | sed -e 's/ganymed/lightcurve/'` 43 logfile=$outpath/lightcurve.log 55 echo $source 56 printprocesslog "INFO processing files for source "$source 57 outpath=$anapath/lightcurves/$date 44 58 makedir $outpath 45 printprocesslog "INFO starting lightcurve.C+ for path "$inpath 59 60 for timebin in ${timebins[@]} 61 do 62 # doing the plots for one night 63 logfile=$outpath"/lightcurve"$source"_"$timebin"min_"$date2".log" 64 outfile=$outpath"/lightcurve"$source"_"$timebin"min_"$date2".root" 65 echo $outfile 66 printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" night "$date2 46 67 47 check1=`root -q -b $anapath/lightcurve.C+\("\"$inpath\""\,"\"$outpath\"","\"$date\""\) | tee $logfile | intgrep`68 check1=`root -q -b $mars2/fact/analysis/lightcurve.C+\($source\,$date2\\,$date2\,$timebin\,"\"$resulttable1"\"\,"\"$outfile\""\) | tee $logfile | intgrep` 48 69 49 case $check1 in 50 0) printprocesslog "INFO lightcurve.C was successful for path "$inpath" (check1=$check1)" 51 ./showplot -b --save-as-png $outpath/lc.root 52 ;; 53 *) printprocesslog "ERROR lightcurve.C failed for dataset "$inpath" (check1=$check1)" 54 ;; 55 esac 70 case $check1 in 71 0) printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" (check1=$check1)" 72 ./showplot -b --save-as-png $outfile 73 ;; 74 1) printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2", but nothing to plot (check1=$check1)" 75 ;; 76 *) printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" night "$date2" (check1=$check1)" 77 ;; 78 esac 79 80 # doing the plots for all nights 81 logfile=$outpath"/lightcurve"$source"_"$timebin"min_all.log" 82 outfile=$outpath"/lightcurve"$source"_"$timebin"min_all.root" 83 echo $outfile 84 printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" night "$date2" all nights" 85 86 check1=`root -q -b $mars2/fact/analysis/lightcurve.C+\($source\,$firstnight\\,$date2\,$timebin\,"\"$resulttable1"\"\,"\"$outfile\""\) | tee $logfile | intgrep` 87 88 case $check1 in 89 0) printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" all nights (check1=$check1)" 90 ./showplot -b --save-as-png $outfile 91 ;; 92 1) printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" all nights, but nothing to plot (check1=$check1)" 93 ;; 94 *) printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" night "$date2" all nights (check1=$check1)" 95 ;; 96 esac 97 done 56 98 done 57 99 printprocesslog "INFO rsync output of source "$source" to gate." 58 rsync -av $anapath/ $source/lightcurve* gate:/home/factwww/lightcurves/$source/100 rsync -av $anapath/lightcurves/ gate:/home/factwww/lightcurves 59 101 done 60 102
Note:
See TracChangeset
for help on using the changeset viewer.