Changeset 18068


Ignore:
Timestamp:
01/04/15 04:57:35 (10 years ago)
Author:
Daniela Dorner
Message:
follow links in find and other small fixes
File:
1 edited

Legend:

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

    r17903 r18068  
    2828# create aux directory on daq, if not yet there
    2929auxpath=/loc_data/aux/$datepath
    30 makedir $auxpath
     30makedir $auxpath >/dev/null
    3131# create path for info files needed for analysis
    3232infopath=$anapath/info/$datepath
    33 makedir $infopath
     33makedir $infopath >/dev/null
    3434echo "" > $infopath/runrow.txt
    3535# create path for callisto output
    3636calpath=$anapath/callisto/$datepath
    37 makedir $calpath
     37makedir $calpath >/dev/null
    3838rawpathnewdaq=/newdaq/raw/$datepath
    3939rawpath=/loc_data/raw/$datepath
     
    105105   finish
    106106fi
    107 fileslocal=( `find $rawpath -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' | sort` )
    108 callistofiles=( `find $calpath -type f -name $date*-calibration.log | sort` )
     107fileslocal=( `find -L $rawpath -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' 2>/dev/null| sort` )
     108callistofiles=( `find $calpath -type f -name $date*-calibration.log 2>/dev/null| sort` )
    109109# get number of dataruns from DB
    110110query="SELECT Count(*) FROM RunInfo WHERE fNight="$date" AND fRunTypeKey=1"
     
    121121
    122122# create raw directory on daq, if not yet there
    123 makedir $rawpath
    124 
    125 echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
     123makedir $rawpath >/dev/null
     124
     125#echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
    126126printprocesslog "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
    127127
     
    134134   
    135135   numcalibrated=0
    136    echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
     136   #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
    137137   printprocesslog "INFO status beginning of while-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
    138138
     
    155155         then
    156156            nondrs=`basename $file | sed -e 's/[.]drs//g'`
    157             nondrsfile=`find $rawpath -name $nondrs.*z`
     157            nondrsfile=`find -L $rawpath -name $nondrs.*z`
    158158            tstop=`$factpath/fitsdump -h $nondrsfile  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
    159159         else
     
    203203      fi
    204204     
     205#      # temporary check
     206#      if [ "`echo $file | grep -o drs`" == "drs" ]
     207#      then
     208#         nondrs=`basename $file | sed -e 's/[.]drs//g'`
     209#         nondrsfile=`find -L $rawpath -name $nondrs.*z`
     210#         tstop=`$factpath/fitsdump -h $nondrsfile  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
     211#      else
     212#         tstop=`$factpath/fitsdump -h $file  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
     213#      fi
     214#      # when stop time is 0, file is not closed
     215#      # when an error is returned the tstop is empty
     216#      if [ "$tstop" == "0" ] || [ "$tstop" == "" ]
     217#      then
     218#         printprocesslog "WARN "$file" not yet closed. -> continue (temporary check)"
     219#         continue
     220#      fi
     221#      # end temporary check
     222     
    205223      # treat other files (.fits.fz)
    206224      runtype=`$factpath/fitsdump -h $localfile  2>/dev/null | grep RUNTYPE | grep -E -o "['][a-z0-9._-]+[']" | sed -e "s/'//g" -e "s/_/-/g" -e "s/[.]//g"`
     
    264282                  calfile=$calpath"/"$date"_"$runnum"_C.root"
    265283                  printprocesslog "INFO starting RunCallisto.sh for drun "$localfile" logfile "$callistolog" drs-calib "$drscalib" drs-time "$drstime" outpath "$outpath" calfile "$calfile
    266                   echo "INFO starting RunCallisto.sh for drun "$localfile" logfile "$callistolog" drs-calib "$drscalib" drs-time "$drstime" outpath "$outpath" calfile "$calfile
     284                  #echo "INFO starting RunCallisto.sh for drun "$localfile" logfile "$callistolog" drs-calib "$drscalib" drs-time "$drstime" outpath "$outpath" calfile "$calfile
    267285                  `dirname $0`/RunCallisto.sh "drun" $callistolog $localfile $drscalib $drstime $calpath $calfile &
    268286               fi
     
    283301               #else
    284302                  # not needed for QLA
     303                  #numcalibrated=`echo " $numcalibrated + 1 " | bc -l`
    285304                  #if ! [ -e $callistolog ]
    286305                  #then
    287306                  #   pedfile=$calpath"/"$date"_"$runnum"-pedestal.root"
    288307                  #   # count runs to be calibrated
    289                   #   numcalibrated=`echo " $numcalibrated + 1 " | bc -l`
    290308                  #   printprocesslog "INFO starting RunCallisto.sh for prun "$localfile" logfile "$callistolog" drs-calib "$drscalib" pedfile "$pedfile
    291309                  #   echo "INFO starting RunCallisto.sh for prun "$localfile" logfile "$callistolog" drs-calib "$drscalib" pedfile "$pedfile
     
    298316            # do lp-treatment -> not needed for QLA
    299317            #lpfile=$calpath"/"$date"_"$runnum"-lightpulser.root"
     318            #numcalibrated=`echo " $numcalibrated + 1 " | bc -l`
    300319            #if ! [ -e $callistolog ]
    301320            #then
     
    303322            #   then
    304323            #      # count runs to be calibrated
    305             #      numcalibrated=`echo " $numcalibrated + 1 " | bc -l`
    306324            #      printprocesslog "INFO starting RunCallisto.sh for crun "$localfile" logfile "$callistolog" drs-calib "$drscalib" drs-time "$drstime" lpfile "$lpfile
    307325            #      echo "INFO starting RunCallisto.sh for crun "$localfile" logfile "$callistolog" drs-calib "$drscalib" drs-time "$drstime" lpfile "$lpfile
     
    314332            drstime=$calpath"/"$date"_"$runnum"-drstime.root"
    315333            # starting calibration
     334            numcalibrated=`echo " $numcalibrated + 1 " | bc -l`
    316335            if ! [ -e $callistolog ]
    317336            then
    318337               # count runs to be calibrated
    319                numcalibrated=`echo " $numcalibrated + 1 " | bc -l`
    320338               printprocesslog "INFO starting RunCallisto.sh for time "$localfile" logfile "$callistolog" drs-ped "$drsped" drstime "$drstime
    321                echo "INFO starting RunCallisto.sh for time "$localfile" logfile "$callistolog" drs-ped "$drsped" drstime "$drstime
     339               #echo "INFO starting RunCallisto.sh for time "$localfile" logfile "$callistolog" drs-ped "$drsped" drstime "$drstime
    322340               `dirname $0`/RunCallisto.sh "time" $callistolog $localfile $drsped $drstime &
    323341            fi
     
    342360   printprocesslog "INFO get new file lists for "$datepath
    343361   files=( `find $rawpathnewdaq -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' | sort` )
    344    fileslocal=( `find $rawpath -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' | sort` )
     362   fileslocal=( `find -L $rawpath -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' | sort` )
    345363   callistofiles=( `find $calpath -type f -name $date*-calibration.log | sort` )
    346    echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
     364   #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
    347365   printprocesslog "INFO status after for-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
    348366
     
    355373      printprocesslog "INFO get new file lists for "$datepath
    356374      files=( `find $rawpathnewdaq -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' | sort` )
    357       fileslocal=( `find $rawpath -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' | sort` )
     375      fileslocal=( `find -L $rawpath -type f -regex '.*[.]fits[.]?[g]?[f]?[z]?' | sort` )
    358376      callistofiles=( `find $calpath -type f -name $date*-calibration.log | sort` )
    359377   fi
    360    echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
     378   #echo "INFO #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
    361379   printprocesslog "INFO status after wait end of while-loop #files-daq:"${#fileslocal[@]}" #files-newdaq:"${#files[@]}" #callisto-logs:"${#callistofiles[@]}" #runs:"$numcalibrated
     380   sleep 30
     381   printprocesslog "INFO sleep 30"
    362382done
    363383
Note: See TracChangeset for help on using the changeset viewer.