Ignore:
Timestamp:
09/06/13 15:59:40 (11 years ago)
Author:
Daniela Dorner
Message:
new macro paths, usage of getdates function, prepared script to be used in RunMoreNights.sh, cleanup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Processing/FillAuxThresholds.sh

    r15330 r17096  
    11#!/bin/bash
    22
    3 # option
    4 doupdate="yes" # update all entries (needed when new fields have been added)
    5 doupdate="no" # fill only entries which are not yet existing (default)
     3# option whether to fill all row or only those where information is missing
     4# $doupdate might be given as environment variable
     5if [ "$doupdate" = "" ]
     6then
     7   doupdate="yes" # update all entries (needed when new fields have been added)
     8   doupdate="no" # fill only entries which are not yet existing (default)
     9fi
    610
    711source `dirname $0`/../Sourcefile.sh
     
    2226
    2327
    24 # get last 3, 6 or 9 nights
    25 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
    26 #        `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
    27 #        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
    28         )
    29 #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
    30 #dates=( `find -L $rawdata -mindepth 3 -type d | sort -r | sed "s/\${rawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /fact/raw
    31 
    32 #dates=( "2013/01/31" )
     28# get dates
     29if [ "$certaindate" != "" ]
     30then
     31   getdates $certaindate
     32else
     33   # get all night
     34   #getdates "all"
     35   # get last 6 nights
     36   getdates 6
     37fi
    3338
    3439printprocesslog "INFO processing the following night(s): "${dates[@]}
    3540echo  `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
    3641
    37 echo ${dates[@]}
     42#echo ${dates[@]}
    3843
    3944cd $mars
     
    4550   runnumber=`echo $date | sed -e 's/\///g'`
    4651
    47    echo $auxdir
    48    
    4952   # check if aux files are available from that night
    5053   if ! [ -d $auxdir ]
     
    5760   
    5861   thresholdfile=$auxdir/$runnumber.RATE_CONTROL_THRESHOLD.fits
    59    ls $thresholdfile
     62   printprocesslog "INFO processing "$thresholdfile
     63   echo "INFO processing "$thresholdfile >> $logfile 2>&1
    6064   if ! [ -e $thresholdfile ]
    6165   then
     
    7175
    7276   thresholdfile2=$auxdir/$runnumber.FTM_CONTROL_STATIC_DATA.fits
    73    ls $thresholdfile2
     77   #ls $thresholdfile2
    7478   if ! [ -e $thresholdfile2 ]
    7579   then
     
    150154      if [ -e $threshcurrentsfile ] && [ $threshnumerrors -eq 0 ]
    151155      then
    152          thresholds1=( `root -q -b -l fact/threshold.C\("\"$thresholdfile2\""\,$tstart\,$tstop\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
     156         thresholds1=( `root -q -b -l fact/processing/threshold.C\("\"$thresholdfile2\""\,$tstart\,$tstop\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
    153157         #root -q -b -l fact/threshold.C\("\"$thresholdfile2\""\,$tstart\,$tstop\) | grep "result"
    154          echo ${thresholds1[@]}
     158         #echo ${thresholds1[@]}
    155159         if [ "${thresholds1[0]}" == "" ]
    156160         then
     
    187191      if [ -e $threshcurrentsfile2 ] && [ $threshnumerrors2 -eq 0 ]
    188192      then
    189          thresholds2=( `root -q -b -l fact/lastth.C\("\"$thresholdfile\""\,$tstart\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
     193         thresholds2=( `root -q -b -l fact/processing/lastth.C\("\"$thresholdfile\""\,$tstart\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
    190194         #root -q -b -l fact/lastth.C\("\"$thresholdfile\""\,$tstart\) | grep "result"
    191          echo ${thresholds2[@]}
     195         #echo ${thresholds2[@]}
    192196         if [ "${thresholds2[0]}" == "" ]
    193197         then
     
    210214      query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum
    211215     
    212       echo $query
     216      #echo $query
    213217      # send query to DB
    214218      sendquery >/dev/null
Note: See TracChangeset for help on using the changeset viewer.