Ignore:
Timestamp:
01/10/06 22:12:58 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets

    r7337 r7460  
    2020#   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
    2121#
    22 #   Copyright: MAGIC Software Development, 2000-2004
     22#   Copyright: MAGIC Software Development, 2000-2006
    2323#
    2424#
    2525# ========================================================================
    2626#
     27# This script launches the inserting of the datasets into the db.
     28#
     29# Extract information (dataset number, source name, comment, observation
     30# mode) from dataset file and insert it into the database in the table
     31# DataSets using the macro insertdataset.C
    2732#
    2833
     
    5560esac
    5661
    57 
     62# get all datasetfiles
    5863datasetfiles=(`ls $datasetpath/*/*`)
    5964echo "datasetfiles: "${datasetfiles[@]}  >> $scriptlog 2>&1
    6065echo "" >> $scriptlog 2>&1
    6166
     67# extract information from dataset file and insert it into db with the macro insertdataset.C
    6268for datasetfile in ${datasetfiles[@]}
    6369do
     70   # get datasetnumber from filename
    6471   no=`echo $datasetfile | cut -d/ -f5 | cut -c8-99 | cut -d. -f1`
     72   # get datasetnumber from file and get it with 8 digits
    6573   no2=`grep 'AnalysisNumber:' $datasetfile | sed -e 's/AnalysisNumber://g' | sed -e 's/ //g'`
    6674   no3=`printf %08d $no2`
     75   # compare the two datasetnumber
     76   # continue only if number is the same
    6777   if [ "$no" = "$no3" ]
    6878   then
     
    7383      continue
    7484   fi
     85   # get source name, comment and observation mode from dataset file
    7586   source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'` >> $scriptlog 2>&1
    7687   comment=`grep 'Comment:' $datasetfile | sed -e 's/Comment://g'` >> $scriptlog 2>&1
     
    94105   insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log
    95106
     107   # insert information into db
    96108   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
    97109   case $check0 in
Note: See TracChangeset for help on using the changeset viewer.