Index: trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets	(revision 7337)
+++ trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets	(revision 7460)
@@ -20,9 +20,14 @@
 #   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
 #
-#   Copyright: MAGIC Software Development, 2000-2004
+#   Copyright: MAGIC Software Development, 2000-2006
 #
 #
 # ========================================================================
 #
+# This script launches the inserting of the datasets into the db.
+#
+# Extract information (dataset number, source name, comment, observation 
+# mode) from dataset file and insert it into the database in the table 
+# DataSets using the macro insertdataset.C
 #
 
@@ -55,14 +60,19 @@
 esac
 
-
+# get all datasetfiles
 datasetfiles=(`ls $datasetpath/*/*`)
 echo "datasetfiles: "${datasetfiles[@]}  >> $scriptlog 2>&1 
 echo "" >> $scriptlog 2>&1 
 
+# extract information from dataset file and insert it into db with the macro insertdataset.C
 for datasetfile in ${datasetfiles[@]}
 do 
+   # get datasetnumber from filename
    no=`echo $datasetfile | cut -d/ -f5 | cut -c8-99 | cut -d. -f1`
+   # get datasetnumber from file and get it with 8 digits
    no2=`grep 'AnalysisNumber:' $datasetfile | sed -e 's/AnalysisNumber://g' | sed -e 's/ //g'`
    no3=`printf %08d $no2`
+   # compare the two datasetnumber 
+   # continue only if number is the same
    if [ "$no" = "$no3" ]
    then 
@@ -73,4 +83,5 @@
       continue
    fi
+   # get source name, comment and observation mode from dataset file
    source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` >> $scriptlog 2>&1 
    comment=`grep 'Comment:' $datasetfile | sed -e 's/Comment://g'` >> $scriptlog 2>&1 
@@ -94,4 +105,5 @@
    insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log
 
+   # insert information into db
    check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
    case $check0 in 
