Index: /trunk/DataCheck/QuickLook/Step2a.sh
===================================================================
--- /trunk/DataCheck/QuickLook/Step2a.sh	(revision 15520)
+++ /trunk/DataCheck/QuickLook/Step2a.sh	(revision 15521)
@@ -23,5 +23,5 @@
 then
    printprocesslog "INFO no image files available for night "$datepath
-   continue
+   finish
 fi
 # write data set file
@@ -34,9 +34,8 @@
 do 
    night=`basename ${files[$i-1]} | cut -d_ -f1`
-   echo "night: "$night
    run=`basename ${files[$i-1]} | cut -d_ -f2`
-   echo "run: "$run
+   printprocesslog "DEBUG night: "$night" run: "$run
    dsfile=$dspath"/dataset"$night"_"$run".txt"
-   echo $dsfile
+   #echo $dsfile
    printprocesslog "INFO writing dataset file "$dsfile
    # write dataset only if merpp-log is available to make sure that star-file is complete
@@ -47,5 +46,5 @@
       echo `dirname ${files[$i-1]}`" "`basename ${files[$i-1]}` > $dsfile
    else
-      echo "merpp still running - wait with file "${files[$i-1]}
+      printprocesslog "INFO merpp still running - wait with file "${files[$i-1]}
       continue
    fi
@@ -54,16 +53,17 @@
    if ! ls $logfile >/dev/null 2>&1
    then
+      # fixme: why is this double? 
       night=`basename ${files[$i-1]} | cut -d_ -f1`
       runid=`basename ${files[$i-1]} | cut -d_ -f2 | cut -d. -f1`
-      echo "night: "$night
-      echo "runid: "$runid
+      #echo "night: "$night
+      #echo "runid: "$runid
       rawfilepath=$rawdata"/"$datepath"/"
       rawfilename=`basename ${files[$i-1]} | sed -e 's/_I.root/.fits/'`
-      echo $rawfilepath
-      echo $rawfilename
+      #echo $rawfilepath
+      #echo $rawfilename
       rawfile=`find $rawfilepath -name $rawfilename*`
-      ls $rawfile
+      printprocesslog "INFO processing "$rawfile
       drivefile=$auxdata"/"$datepath"/"`basename ${files[$i-1]} | cut -d_ -f1`".DRIVE_CONTROL_SOURCE_POSITION.fits"
-      ls $drivefile
+      printprocesslog "INFO getting coordinates from "$drivefile
       tstopi=`$factpath/fitsdump -h $rawfile  2>/dev/null | grep TSTOPI | grep -E -o '[0-9]+'`
       tstopf=`$factpath/fitsdump -h $rawfile  2>/dev/null | grep TSTOPF | grep -E -o '[.][0-9]+'`
@@ -76,5 +76,5 @@
          then
             printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile
-            echo "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile
+            #echo "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile
             continue
          fi
@@ -82,10 +82,10 @@
          then
             printprocesslog "WARN coordinates "${coordinates[@]}
-            echo "WARN coordinates "${coordinates[@]}
+            #echo "WARN coordinates "${coordinates[@]}
             continue
          fi
       else
          printprocesslog "DEBUG coordinates "${coordinates[@]}
-         echo "DEBUG coordinates "${coordinates[@]}
+         #echo "DEBUG coordinates "${coordinates[@]}
          query="SELECT fSourceKEY FROM RunInfo WHERE fNight="$night" AND fRunID="$runid
          sourcekey=`sendquery`
@@ -93,5 +93,5 @@
          then
             printprocesslog "WARN sourcekey empty - coordinates"${coordinates[@]}
-            echo "WARN sourcekey empty - coordinates"${coordinates[@]}" for "$rawfile
+            #echo "WARN sourcekey empty - coordinates"${coordinates[@]}" for "$rawfile
             continue
          fi
@@ -101,5 +101,5 @@
          then
             printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile
-            echo "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile
+            #echo "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile
             continue
          fi
@@ -107,16 +107,16 @@
          then
             printprocesslog "WARN coordinates "${coordinates[@]}
-            echo "WARN coordinates "${coordinates[@]}
+            #echo "WARN coordinates "${coordinates[@]}
             continue
          fi
       fi
 
-      echo $logfile" "${files[$i-1]}" -"${coordinates[0]}"-"${coordinates[1]}
-      echo "`dirname $0`/RunGanymed.sh $dsfile "${coordinates[0]}" "${coordinates[1]}
+      printprocesslog "DEBUG "$logfile" "${files[$i-1]}" -"${coordinates[0]}"-"${coordinates[1]}
+      printprocesslog "DEBUG `dirname $0`/RunGanymed.sh $dsfile "${coordinates[0]}" "${coordinates[1]}
       `dirname $0`/RunGanymed.sh $dsfile ${coordinates[0]} ${coordinates[1]}
       numganymeds=`echo " $numganymeds + 1 " | bc -l`
    fi
 done 
-echo "found "$numganymeds" ganymeds."
+printprocesslog "INFO found "$numganymeds" ganymeds."
    
 #   # get list of 5min-dataset-files as starting point
