Index: trunk/MagicSoft/Mars/datacenter/scripts/processmcsequences
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/processmcsequences	(revision 7448)
+++ trunk/MagicSoft/Mars/datacenter/scripts/processmcsequences	(revision 7460)
@@ -20,9 +20,14 @@
 #   Author(s): Daniela Dorner  12/2005 <mailto:dorner@astro.uni-wuerzburg.de>
 #
-#   Copyright: MAGIC Software Development, 2000-2004
+#   Copyright: MAGIC Software Development, 2000-2006
 #
 #
 # ========================================================================
 #
+# This script is an intermediate solution to process the montecarlo files.
+# As soon as the montecarlo database is running, this script shall be 
+# exchanged. 
+# 
+# The script is processing the montecarlo sequences: callisto and star
 #
 
@@ -38,4 +43,5 @@
 date >> $scriptlog 2>&1
 
+# check if script is already running
 lockfile=$lockpath/lock-processmcsequences.txt
 date > $lockfile >> $scriptlog 2>&1 
@@ -50,5 +56,4 @@
 esac
 
-
 mcpath=/montecarlo/rawfiles
 mccalpath=/montecarlo/callisto
@@ -57,8 +62,8 @@
 callistorc=$setuppath/callisto/callisto.rc
 
-sequfiles=`find $mcsequpath -type f`
-
 cd $mars
 
+# find montecarlo sequence files
+sequfiles=`find $mcsequpath -type f`
 for sequfile in ${sequfiles[@]}
 do 
@@ -69,9 +74,10 @@
    makedir $caloutpath >> $scriptlog 2>&1
    
+   # continue with next sequence, if sequence is already processed 
+   #  or processing  of sequence is just running
    if ls $caloutpath/.done >> $scriptlog 2>&1
    then 
       continue
    fi
-   
    if ls $caloutpath/.doing >> $scriptlog 2>&1
    then 
@@ -79,8 +85,8 @@
    fi
    
+   # lock file
    touch $caloutpath/.doing
-   
    echo "processing sequ $sequfile" >> $scriptlog 2>&1
-   
+   # find callisto.rc file
    if [ -e $caloutpath/callisto.rc ]
    then
@@ -92,9 +98,9 @@
       callistorcseq=$caloutpath/callisto.rc
    fi
-   
+   # calibrate data
    echo "./callisto -mc -f -b -q --ind=$mcpath/$date --log=$caloutpath/callisto$sequno.log --html=$caloutpath/callisto$sequno.html --out=$caloutpath --config=$callistorcseq $sequfile 2>> $scriptlog > /dev/null" >> $scriptlog 2>&1
    ./callisto -mc -f -b -q --ind=$mcpath/$date --log=$caloutpath/callisto$sequno.log --html=$caloutpath/callisto$sequno.html --out=$caloutpath --config=$callistorcseq $sequfile 2>> $scriptlog > /dev/null
    check1=$?
-  
+   # if calibration worked -> run star for sequence
    case $check1 in
       0)   echo "check1=$check1 -> everything ok..." >> $scriptlog 2>&1
@@ -103,4 +109,5 @@
            imgoutpath=$mccalpath/$no/$sequno
            makedir $imgoutpath >> $scriptlog 2>&1
+           
            ./star -b -q -v4 -f -mc --log=$imgoutpath/star$sequno.log --html=$imgoutpath/star$sequno.html --ind=$caloutpath --out=$imgoutpath $sequfile  2>> $scriptlog> /dev/null
            check2=$?
@@ -118,5 +125,4 @@
 done
 
-
 rm -v $lockfile >> $scriptlog 2>&1
 
