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/runcallisto

    r7426 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 is launching the calibration of sequences.
     28#
     29# In the case of calibration only one sequence is processed. Despite of
     30# that the structure of the script is such, that also more sequences could
     31# be processed. The restriction to one sequence has been made, as the
     32# calibration takes some time. There's one todo file per sequence.
     33# First the script searches for a todo file. Then the sequence from this
     34# todo file is calibrated and the merpp update is done.
     35#
     36# the callisto.rc files are stored in the setup directory
    2737#
    2838
     
    3242set -C
    3343
     44# define callisto.rc files
    3445callistorcnew=$setuppath/callisto/callisto.rc
    3546callistorcmarapr05=$setuppath/callisto/callisto_MarApr05.rc
     
    5667cd $mars
    5768
     69# get todo file
    5870echo "checking if other todo-files are there" >> $scriptlog 2>&1
    5971if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
     
    7385   esac
    7486
    75    if  ls $todofile-[1-9]*.txt >> $scriptlog 2>&1
    76    then
    77       echo "other file(s) on disk " >> $scriptlog 2>&1
    78       echo " -> choose one file and start calibrating" >> $scriptlog 2>&1
    79    else
    80       echo "getting list..." >> $scriptlog 2>&1
    81       check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    82 
    83       case $check0 in
    84           1)   echo "check0=$check0 -> everything ok -> run callisto" >> $scriptlog 2>&1;;
    85           *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    86       esac
    87    fi
     87   echo "getting list..." >> $scriptlog 2>&1
     88   check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     89
     90   case $check0 in
     91      1)   echo "check0=$check0 -> everything ok -> run callisto" >> $scriptlog 2>&1;;
     92      *)   echo "check0=$check0 -> ERROR -> could not get todo list -> exit" >> $scriptlog 2>&1
     93           rm -v $lockpath/lock-getting-callisto-list.txt >> $scriptlog 2>&1
     94           date  >> $scriptlog 2>&1
     95           exit;;
     96   esac
    8897   rm -v $lockpath/lock-getting-callisto-list.txt >> $scriptlog 2>&1
    8998fi
    9099
    91 
     100# choose todo file
    92101nr=bla
    93102echo "finding the right todo-file" >> $scriptlog 2>&1
    94103todofiles=`ls -r $listpath/ToDo-$table-$column-*`
    95 
    96 #echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1
    97104
    98105for todofile in ${todofiles[@]}
     
    122129esac
    123130
     131# get sequence(s) from todo file
    124132sequences=(`cat $todofile`)
    125 
    126133if [ "$sequences" = "" ]
    127134then
     
    133140fi
    134141
     142# run calibration for sequence(s)
    135143echo "sequences: "${sequences[@]} >> $scriptlog 2>&1
    136 
    137144for sequence in ${sequences[@]}
    138145do
     
    146153  echo "sequfile: "$sequfile >> $scriptlog 2>&1
    147154 
     155  # find callisto.rc file
    148156  if [ -e $outpath/callisto.rc ]
    149157  then
     
    167175  case $check1 in
    168176     0)   echo "check1=$check1 -> everything ok -> doing update..." >> $scriptlog 2>&1
     177          # running merpp update if calibration worked
     178          # finding files, which have to be updated
    169179          echo "finding files to be updated" >> $scriptlog 2>&1
    170180          calfiles=`find $outpath -name *_Y_* `
     
    179189          makedir $merpplogpath >> $scriptlog 2>&1
    180190         
     191          # updated calibrated data files with the information from the cc and caco files
    181192          for calfile in ${calfiles[@]}
    182193          do
    183194             echo "calfile: "$calfile >> $scriptlog 2>&1
     195             # find cc and caco file
     196             # if file is missing continue with next sequence
    184197             runno=`echo $calfile | cut -d_ -f2 | sed -e 's/^0//' | sed -e 's/^0//' | sed -e 's/^0//' `
    185198             ccfile=`find /magic/subsystemdata/cc/ -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep`
     
    232245          done
    233246         
     247          # set status for calibration if merpp updates are also done
    234248          echo "inserting the status for callisto for sequence $sequence into the db" >> $scriptlog 2>&1
    235249          setstatuslogpath=$logpath/setstatus/callisto/$no
Note: See TracChangeset for help on using the changeset viewer.