Ignore:
Timestamp:
12/18/16 18:38:15 (8 years ago)
Author:
Daniela Dorner
Message:
improved logging
File:
1 edited

Legend:

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

    r18662 r18682  
    6363   if [ "$2" = "" ]
    6464   then
    65       printprocesslog "WARN couldn't get statistics from file $1 for run "$date" "$file
     65      printprocesslog "WARN couldn't get statistics from file $1 for run "$date" "$rawfile
    6666      continue
    6767   fi
     
    7474   if [ "$evaluation" = "" ]
    7575   then
    76       printprocesslog "WARN empty evaluation of statistic ("$@") for run "$date" "$file
     76      if [ $runtypekey -ne 1 ] #|| [ $sourcekey -gt 0 ] #doesn't work as sourcekey can be empty
     77      then
     78         printprocesslog "DEBUG empty evaluation of statistic ("$@") for run "$date" file "$rawfile
     79      else
     80         printprocesslog "WARN empty evaluation of statistic ("$@") for run "$date" file "$rawfile
     81      fi
    7782   fi
    7883   min=`echo $evaluation | grep -E -o 'Min:\ [-]?[0-9]+[.]?[0-9]*' | sed -e 's/Min:\ //'`
     
    173178 
    174179      # get information from rawfile
    175       rawfile=`ls $rawdir/$runnumber"_"\`printf %03d $filenum\`.fits*`
     180      rawfile=`ls $rawdir/$runnumber"_"\`printf %03d $filenum\`.fits* 2>/dev/null`
    176181      if ! [ -e $rawfile ]
    177182      then
     
    180185      fi
    181186
    182       #runtype=`$factpath/fitsdump -h $rawfile  2>/dev/null | grep RUNTYPE | grep -E -o "['][a-z-]+[']" | sed -e "s/'//g"`
     187      runtype=`$factpath/fitsdump -h $rawfile  2>/dev/null | grep RUNTYPE | grep -E -o "['][a-z-]+[']" | sed -e "s/'//g"`
    183188      #mjdrefraw=`$factpath/fitsdump -h $rawfile  2>/dev/null | grep 'MJDREF' | grep -E -o '[0-9]{5}'`
    184189      tstarti=`$factpath/fitsdump -h $rawfile  2>/dev/null | grep 'TSTARTI' | grep -E -o '[0-9]{5}'`
     
    234239         fi
    235240      fi
     241      # set runtype to 'unknown', if no runtype could be retrieved from file
     242      if [ "$runtype" == "" ]
     243      then
     244         runtype="n/a"
     245      fi
     246      # on 15.11.2011 the runtypes had different names
     247      if [ "$date" == "2011/11/15" ]
     248      then
     249         if [ "$runtype" == "drs-calib" ]
     250         then
     251            runtype="drs-gain"
     252         fi
     253         if [ "$runtype" == "drs-time-calib" ]
     254         then
     255            runtype="drs-time"
     256         fi
     257         if [ "$runtype" == "pedestal" ]
     258         then
     259            runtype="drs-pedestal"
     260         fi
     261         if [ "$runtype" == "light-pulser" ]
     262         then
     263            runtype="light-pulser-ext"
     264         fi
     265         if [ "$runtype" == "pedestal-on" ]
     266         then
     267            runtype="pedestal"
     268         fi
     269      fi
     270      # get runtype
     271      query="SELECT fRunTypeKEY FROM RunType WHERE fRunTypeName='"$runtype"'"
     272      result2=( `sendquery` )
     273      if [ ${#result2} -eq 0 ]
     274      then
     275         printprocesslog "ERROR "$numberfromname": Could not query fRunTypeKey for runtype "$runtype" ."
     276         continue
     277      fi
     278      runtypekey=${result2[0]}
     279
    236280      if [ "$doupdate" == "force" ]
    237281      then
    238          # set runtype to 'unknown', if no runtype could be retrieved from file
    239          if [ "$runtype" == "" ]
    240          then
    241             runtype="n/a"
    242          fi
    243          # on 15.11.2011 the runtypes had different names
    244          if [ "$date" == "2011/11/15" ]
    245          then
    246             if [ "$runtype" == "drs-calib" ]
    247             then
    248                runtype="drs-gain"
    249             fi
    250             if [ "$runtype" == "drs-time-calib" ]
    251             then
    252                runtype="drs-time"
    253             fi
    254             if [ "$runtype" == "pedestal" ]
    255             then
    256                runtype="drs-pedestal"
    257             fi
    258             if [ "$runtype" == "light-pulser" ]
    259             then
    260                runtype="light-pulser-ext"
    261             fi
    262             if [ "$runtype" == "pedestal-on" ]
    263             then
    264                runtype="pedestal"
    265             fi
    266          fi
    267          # get runtype
    268          query="SELECT fRunTypeKEY FROM RunType WHERE fRunTypeName='"$runtype"'"
    269          result2=( `sendquery` )
    270          if [ ${#result2} -eq 0 ]
    271          then
    272             printprocesslog "ERROR "$numberfromname": Could not query fRunTypeKey for runtype "$runtype" ."
    273             continue
    274          fi
    275282         # in newest data start time is in DATE-OBS
    276283         # in older data start time is in TSTART
     
    537544      then
    538545         query=$query", fRunStart='"$runstart"', fRunStop='"$runstop"'"
    539          query=$query", fRunTypeKey="${result2[0]}
     546         query=$query", fRunTypeKey="$runtypekey
    540547         if [ "$numevents" != "" ]
    541548         then
Note: See TracChangeset for help on using the changeset viewer.