Index: trunk/DataCheck/QuickLook/RunGanymed.sh
===================================================================
--- trunk/DataCheck/QuickLook/RunGanymed.sh	(revision 18093)
+++ trunk/DataCheck/QuickLook/RunGanymed.sh	(revision 18098)
@@ -17,6 +17,6 @@
 fi
 
-# getting coordinates from raw and drive
-date=`echo $starfile | grep -o -E '20[0-9][0-9]/[0-3][0-9]/[0-2][0-9]'`
+# getting coordinates from raw and drive or DB
+date=`echo $starfile | grep -o -E '20[0-9][0-9]/[0-3][0-9]/[0-3][0-9]'`
 drivefile=$auxdata"/"$date"/"`basename $starfile | cut -d_ -f1`".DRIVE_CONTROL_SOURCE_POSITION.fits"
 rawfile=$rawdata"/"$date"/"`basename $starfile | sed -e 's/_I.root/.fits.fz/'`
@@ -27,4 +27,14 @@
    tstopf=`$factpath/fitsdump -h $rawfile  2>/dev/null | grep TSTOPF | grep -E -o '[.][0-9]+'`
    tstop=${tstopi}${tstopf}
+else
+   printprocesslog "WARN "$rawfile" not found."
+fi
+if [ "$tstop" == "" ]
+then
+   printprocesslog "WARN tstop empty "$rawfile
+fi
+if ! ls $drivefile >/dev/null 2>&1
+then 
+   printprocesslog "WARN "$drivefile" missing."
 fi
 if  ls $drivefile >/dev/null 2>&1  && ! [ "$tstop" == "" ]
@@ -45,4 +55,6 @@
    fi
 else
+   night=`echo $date | sed -e 's/\///g'`
+   runid=`basename $starfile | cut -d_ -f2`
    printprocesslog "INFO getting coordinates from DB."
    query="SELECT fSourceKEY FROM RunInfo WHERE fNight="$night" AND fRunID="$runid
@@ -50,6 +62,5 @@
    if [ "$sourcekey" == "" ]
    then
-      printprocesslog "WARN sourcekey empty - coordinates"${coordinates[@]}
-      #echo "WARN sourcekey empty - coordinates"${coordinates[@]}" for "$rawfile
+      printprocesslog "WARN sourcekey empty for "$night"_"$runid" - coordinates"${coordinates[@]}
       finish
    fi
@@ -58,12 +69,10 @@
    if [ "${coordinates[0]}" == "" ] || [ "${coordinates[1]}" == "" ]
    then
-      printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") from DB."
-      #echo "WARN couldn't get coordinates ("${coordinates[@]}") from "$drivefile
+      printprocesslog "WARN couldn't get coordinates ("${coordinates[@]}") for "$night"_"$runid" from DB."
       finish
    fi
    if [ "${coordinates[0]}" == "0" ] || [ "${coordinates[1]}" == "0" ]
    then
-      printprocesslog "WARN coordinates "${coordinates[@]}
-      #echo "WARN coordinates "${coordinates[@]}
+      printprocesslog "WARN coordinates "${coordinates[@]}" for "$night"_"$runid
       finish
    fi
@@ -76,5 +85,5 @@
 makedir $outpath
 
-output=$outpath/`basename $starfile | cut -dI -f1`
+output=$outpath/`basename $starfile | cut -d_ -f1-2`
 logfile=$output"-ganymed.log"
 ganymedfile=$output"-analysis.root"
