Index: trunk/DataCheck/Processing/FillMoonInfo.sh
===================================================================
--- trunk/DataCheck/Processing/FillMoonInfo.sh	(revision 17093)
+++ trunk/DataCheck/Processing/FillMoonInfo.sh	(revision 17094)
@@ -1,26 +1,31 @@
 #!/bin/bash
 
-# option 
-doupdate="yes" # update all entries (needed when new fields have been added)
-doupdate="no" # fill only entries which are not yet existing (default)
+# script to fill moon information to DB
+# doesn't need raw files
+# probably doesn't run at ISDC (FACT++/moon missing)
+
+# option whether to fill all row or only those where information is missing
+# $doupdate might be given as environment variable
+if [ "$doupdate" = "" ]
+then
+   doupdate="yes" # update all entries (needed when new fields have been added)
+   doupdate="no" # fill only entries which are not yet existing (default)
+fi
 
 source `dirname $0`/../Sourcefile.sh
 printprocesslog "INFO starting $0 with option doupdate="$doupdate
 
-#logfile=$runlogpath"/FillMoonInfo-"$datetime".log"
-#date >> $logfile
-
-# get last 3, 6 or 9 nights
-dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
-        `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
-#        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
-        )
-
-#dates=( `date +%Y/%m/%d --date="-228hour"` `date +%Y/%m/%d --date="-252hour"` `date +%Y/%m/%d --date="-276hour"` )
-
-#dates=( `find $auxdata -mindepth 3 -type d | sort -r | sed "s/\${auxdata_for_sed}//g" | sed -e 's/^\///'` )
+# get dates
+if [ "$certaindate" != "" ]
+then
+   getdates $certaindate
+else
+   # get all night
+   #getdates "all"
+   # get last 6 nights
+   getdates 6
+fi
 
 printprocesslog "INFO processing the following night(s): "${dates[@]}
-#echo  `date`": processing the following night(s): "${dates[@]} #>> $logfile 2>&1
 
 # do filling of aux data 
@@ -37,7 +42,5 @@
    # get file numbers from DB
    #   but only for not-corrupted files
-   #query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND NOT ISNULL(fRightAscension) AND NOT ISNULL(fDeclination) "
    query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND NOT ISNULL(fRunStart) "
-   #query=$query" AND fRunTypeKEY=6 "
    if [ "$doupdate" = "no" ]
    then
@@ -56,5 +59,4 @@
    do
       printprocesslog "INFO processing file number "$runnumber"_"`printf %03d $filenum`
-      #echo  `date`": processing file number "$runnumber"_"`printf %03d $filenum` # >> $logfile 2>&1
       
       # get input info from DB 
@@ -65,6 +67,4 @@
       query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum
       info=( `sendquery` )
-      #echo ${info[@]}
-      #echo "/home/fact/FACT++.db/moon "${info[2]} ${info[3]}" --ra=${info[0]} --dec=${info[1]} 2>/dev/null"
       if [ "${info[0]}" == "999" ] && [ "${info[1]}" == "999" ]
       then 
@@ -75,5 +75,4 @@
       # return values of the programm
       # timestamp sunzd moon-visible moondisk moonzd angletomoon angletosun
-      #echo ${lightinfo[@]}
       
       # build query to update runinfo in DB
@@ -87,4 +86,5 @@
       # add where condition
       query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum
+
       #echo $query
       # send query to DB
