Ignore:
Timestamp:
12/13/06 14:23:09 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/scripts/processsequence

    r8034 r8231  
    6666   echo ""
    6767   echo "Remarks: "
    68    echo    " - you can set the variables (or part of it) also in the script "
     68   echo    " - you can set the needed variables also in the script "
    6969   echo    " - you have to set the outpath and either the sequence number or the sequence file"
    7070   echo    "    (if both is set, the sequence given by the sequencefile is processed)"
     71   echo    " - you have to execute the script from your mars directory"
    7172   echo ""
    7273   exit
    7374}
     75
     76function checkreturncode()
     77{
     78   case $check in
     79      0)  echo "$program finished sucessfully"
     80          echo ""
     81          ;;
     82     [1-9]|[0-9][0-9]|1[0-1][0-9]|12[0-7])
     83          echo -n "ERROR@$HOSTNAME: $program returned $check - please check the logfile $logfile"
     84          if [ "$program" == "callisto" ]
     85          then
     86             echo -n " - for more details see http://www.astro.uni-wuerzburg.de/datacenter/instructions/intern/errorcoding.txt"
     87          fi
     88          echo " you executed the following command: "$command
     89          exit
     90          ;;
     91      *)  echo -n "ERROR@$HOSTNAME: $program returned $check - please check the logfile $logfile"
     92          echo -n " $program returned a signal > 127 ($check)"
     93          echo " you executed the following command: "$command
     94          exit;;
     95   esac
     96}
     97
    7498
    7599interactive="yes"
     
    80104           --sequ)  shift
    81105                    sequence=$1
    82                     ;;
    83            --mars)  shift
    84                     mars=$1
    85106                    ;;
    86107            --out)  shift
     
    136157   echo " sequence: "$sequence
    137158   echo " sequfile: "$sequfile
    138    if ! [ "$star" = "yes" ] || [ "$cal" = "yes" ]
    139    then
     159#   if ! [ "$star" = "yes" ] || [ "$cal" = "yes" ]
     160#   then
    140161      calpath=$outpath"/callisto/$n8"
    141162      echo " path where calibration files are stored : "$calpath
    142    fi
     163#   fi
    143164   if ! [ "$cal" = "yes" ] || [ "$star" = "yes" ]
    144165   then
     
    148169else
    149170   echo " sequfile: "$sequfile
    150    if ! [ "$star" = "yes" ] || [ "$cal" = "yes" ]
    151    then
     171#   if ! [ "$star" = "yes" ] || [ "$cal" = "yes" ]
     172#   then
    152173      calpath=$outpath"/callisto"
    153174      echo " path where calibration files are stored : "$calpath
    154    fi
     175#   fi
    155176   if ! [ "$cal" = "yes" ] || [ "$star" = "yes" ]
    156177   then
     
    185206   mkdir -pv $calpath
    186207
    187    echo "run callisto..."
    188    echo "./callisto -b -q -f --log=$calpath/callisto$sequence.log --out=$calpath $sequfile "
    189    ./callisto -b -q -f --log=$calpath/callisto$sequence.log --out=$calpath $sequfile
     208   program=callisto
     209   echo "run $program..."
     210   logfile=$calpath/$program$sequence.log
     211   command="./$program -b -q -f --log=$logfile --out=$calpath $sequfile "
     212   echo $command
     213   $command
    190214   check=$?
    191    case $check in
    192       0)  echo "callisto finished sucessfully"
    193           echo "";;
    194       *)  echo -n "ERROR: callisto returned $check - please check "
    195           echo -n "http://www.astro.uni-wuerzburg.de/datacenter/instructions/intern/errorcoding.txt"
    196           echo " for more details"
    197           exit;;
    198    esac
    199 
     215   checkreturncode
    200216
    201217   calfiles=`find $calpath -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*_Y_*.root`
     
    214230
    215231      runno=`echo $calfile | cut -d_ -f2 | sed -e 's/^0//' | sed -e 's/^0//' | sed -e 's/^0//' `
    216       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`
    217       cacofile=`find /magic/subsystemdata/caco/ -name dc_[2][0][0-2][0-9]_[0,1][0-9]_[0-3][0-9]_*${runno}_*.txt`
     232      ccfile=`find /magic/subsystemdata/cc/ -name 20[0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep`
     233      cacofile=`find /magic/subsystemdata/caco/ -name dc_20[0-2][0-9]_[01][0-9]_[0-3][0-9]_*${runno}_*.txt`
    218234      echo "runno: "$runno
    219235      echo "ccfile: "$ccfile
     
    245261         done
    246262      fi
     263
     264      program=merppccupdate
     265      logfile=$merpplogpath/$program$runno.log
     266      command="./merpp -u --log=$logfile --runfile=$runno $ccfile $calfile "
     267      echo $command
     268      $command
     269      check=$?
     270      checkreturncode
    247271     
    248       logfile=$merpplogpath/merppccupdate$runno.log
    249       echo "./merpp -u --log=$logfile --runfile=$runno $ccfile $calfile "
    250       ./merpp -u --log=$logfile --runfile=$runno $ccfile $calfile
     272      program=merppcacoupdate
     273      logfile=$merpplogpath/$program$runno.log
     274      command="./merpp -u --log=$logfile --auto-time $cacofile $calfile"
     275      echo $command
     276      $command
    251277      check=$?
    252       case $check in
    253          0)  ;;
    254          *)  echo "ERROR: merppccupdate returned $check "
    255              echo "please check the logfile $logfile "
    256              exit;;
    257       esac
    258 
    259       logfile=$merpplogpath/merppcacoupdate$runno.log
    260       echo "./merpp -u --log=$logfile --auto-time $cacofile $calfile "
    261       ./merpp -u --log=$logfile --auto-time $cacofile $calfile
    262       check=$?
    263       case $check in
    264          0)  ;;
    265          *)  echo "ERROR: merppcacoupdate returned $check "
    266              echo "please check the logfile $logfile "
    267              exit;;
    268       esac
     278      checkreturncode
     279     
    269280   done
    270281   echo "merppupdate is finished"
     
    276287   mkdir -pv $starpath
    277288
    278    echo "run star..."
    279    logfile=$starpath/star$sequence.log
     289   program=star
     290   echo "run $program..."
     291   logfile=$starpath/$program$sequence.log
    280292   if ! ls $calpath
    281293   then
    282       echo "couldn't find $calpath => taking standard inpath for star"
    283       echo "./star -b -q -f --log=$logfile --out=$starpath $sequfile "
    284       ./star -b -q -f --log=$logfile --out=$starpath $sequfile
     294      echo "couldn't find $calpath => taking standard inpath for $program"
     295      command="./$program -b -q -f --log=$logfile --out=$starpath $sequfile"
     296      echo $command
     297      $command
    285298   else
    286       echo "./star -b -q -f --log=$logfile --ind=$calpath --out=$starpath $sequfile "
    287       ./star -b -q -f --log=$logfile --ind=$calpath --out=$starpath $sequfile
     299      command="./$program -b -q -f --log=$logfile --ind=$calpath --out=$starpath $sequfile"
     300      echo $command
     301      $command
    288302   fi
    289303   check=$?
    290    case $check in
    291       0)  echo "star finished sucessfully"
    292           echo "";;
    293       *)  echo "ERROR: star returned $check - please check "
    294           echo "please check the logfile $logfile "
    295           exit;;
    296    esac
    297 
    298    echo "star is finished "
    299 fi
    300 
     304   checkreturncode
     305fi
     306
Note: See TracChangeset for help on using the changeset viewer.