Ignore:
Timestamp:
01/10/06 22:12:58 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck

    r7329 r7460  
    2020#   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
    2121#
    22 #   Copyright: MAGIC Software Development, 2000-2004
     22#   Copyright: MAGIC Software Development, 2000-2006
    2323#
    2424#
    2525# ========================================================================
    2626#
     27# This script launches the datacheck for all runs, which are not yet
     28# checked
     29#
     30# After checking, if the script is already running, the todolist is
     31# written by using the macro getdolist.C
     32# Then for each run the following steps are done:
     33#  - filldotraw.C
     34#  - sinope (once for data and once for calibration events)
     35#  - fillsinope
     36#  - reset ExclusionsDone, so that the result from the datacheck can be
     37#    taken into account when doexclusions is running the next time
     38# If this was successful, the status is inserted into the database using
     39# the macro setstatus.C
    2740#
    2841
     
    4659scriptlogpath=$logpath/run/dodatacheck/`date +%Y/%m`
    4760makedir $scriptlogpath
    48 
    4961scriptlog=$scriptlogpath/dodatacheck-$datetime.log
    5062
     
    5365makedir $getstatuslogpath >> $scriptlog 2>&1
    5466
     67# check if there are already todo files
    5568echo "checking if other todo-files are there" >> $scriptlog 2>&1
    5669if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
    5770then
    5871   echo "other file(s) on disk " >> $scriptlog 2>&1
    59    echo " -> choose one file and start calibrating" >> $scriptlog 2>&1
     72   echo " -> choose one file and start datacheck " >> $scriptlog 2>&1
    6073else
    6174   date > $lockpath/lock-getting-dodatacheck-list.txt >> $scriptlog 2>&1
     
    7083   esac
    7184
    72    if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
    73    then
    74       echo "other file(s) on disk " >> $scriptlog 2>&1
    75       echo " -> choose one file and start datacheck" >> $scriptlog 2>&1
    76    else
    77       echo "getting list..." >> $scriptlog 2>&1
    78       check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    79 
    80       case $check0 in
    81           1)   echo "check0=$check0 -> everything ok -> do datacheck" >> $scriptlog 2>&1;;
    82           *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    83       esac
    84    fi
     85   echo "getting list..." >> $scriptlog 2>&1
     86   check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     87
     88   case $check0 in
     89      1)   echo "check0=$check0 -> everything ok -> do datacheck" >> $scriptlog 2>&1;;
     90      *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
     91   esac
    8592   rm -v $lockpath/lock-getting-dodatacheck-list.txt >> $scriptlog 2>&1
    8693fi
    8794
    8895
     96# finding a todo file
    8997nr=bla
    9098echo "finding the right todo-file" >> $scriptlog 2>&1
     
    92100
    93101echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
    94 
    95102for todofile in ${todofiles[@]}
    96103do
     
    120127
    121128
     129# get run(s) from todo file
    122130runs=(`cat $todofile`)
    123 
    124131if [ "$runs" = "" ]
    125132then
     
    131138fi
    132139
     140# processing run(s)
    133141echo "runs: "${runs[@]} >> $scriptlog 2>&1
    134 
    135142for run in ${runs[@]}
    136143do
     
    143150   date=`find /magic/data/rawfiles/ -name *${run}_[D,P,C,S]_*_E.raw | cut -c 22-31`
    144151   echo "date: "$date >> $scriptlog 2>&1
     152   # for sinope the date is needed in the format YYYY-MM-DD
    145153   date2=`echo $date | sed -e 's/\//-/g'`
    146154   echo "date2: "$date2 >> $scriptlog 2>&1
    147155
     156   # running filldotraw
    148157   filldotrawpath=$logpath/filldotraw/$date
    149158   makedir $filldotrawpath >> $scriptlog 2>&1
     
    160169   esac
    161170   
     171   # running sinope
    162172   sinopepath=$datapath/sinope/$date
    163173   makedir $sinopepath >> $scriptlog 2>&1
     
    183193   done
    184194   
     195   # running fillsinope
    185196   fillsinopepath=$logpath/fillsinope/$date
    186197   makedir $fillsinopepath >> $scriptlog 2>&1
     
    191202
    192203   case $check3 in
    193        1)   echo "check3=$check3 -> everything ok -> set exclusions..." >> $scriptlog 2>&1
     204       1)   echo "check3=$check3 -> everything ok -> set status..." >> $scriptlog 2>&1
    194205            ;;
    195206       *)   echo "check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     
    197208   esac
    198209
    199    echo "resetting the status for fExclusions done for date $date2" >> $scriptlog 2>&1
     210   # resetting the status for exclusions
     211   echo "resetting the status for fExclusionsDone for date $date2" >> $scriptlog 2>&1
    200212   resetlogpath=$logpath/resetexclusions/$date
    201213   echo "resetlogpath: $resetlogpath" >> $scriptlog 2>&1
     
    212224   esac
    213225
     226   # set status
    214227   echo "inserting the status for the datacheck for run $run into the db" >> $scriptlog 2>&1
    215228   setstatuslogpath=$logpath/setstatus/datacheck/$date
Note: See TracChangeset for help on using the changeset viewer.