| 1 | #!/bin/sh
|
|---|
| 2 | #
|
|---|
| 3 | # ========================================================================
|
|---|
| 4 | #
|
|---|
| 5 | # *
|
|---|
| 6 | # * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
|---|
| 7 | # * Software. It is distributed to you in the hope that it can be a useful
|
|---|
| 8 | # * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
|---|
| 9 | # * It is distributed WITHOUT ANY WARRANTY.
|
|---|
| 10 | # *
|
|---|
| 11 | # * Permission to use, copy, modify and distribute this software and its
|
|---|
| 12 | # * documentation for any purpose is hereby granted without fee,
|
|---|
| 13 | # * provided that the above copyright notice appear in all copies and
|
|---|
| 14 | # * that both that copyright notice and this permission notice appear
|
|---|
| 15 | # * in supporting documentation. It is provided "as is" without express
|
|---|
| 16 | # * or implied warranty.
|
|---|
| 17 | # *
|
|---|
| 18 | #
|
|---|
| 19 | #
|
|---|
| 20 | # Author(s): Daniela Dorner 08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
|
|---|
| 21 | #
|
|---|
| 22 | # Copyright: MAGIC Software Development, 2000-2004
|
|---|
| 23 | #
|
|---|
| 24 | #
|
|---|
| 25 | # ========================================================================
|
|---|
| 26 | #
|
|---|
| 27 | #
|
|---|
| 28 |
|
|---|
| 29 | source /home/operator/Mars.cvs/datacenter/scripts/sourcefile
|
|---|
| 30 |
|
|---|
| 31 | set -C
|
|---|
| 32 |
|
|---|
| 33 | #cd $mars
|
|---|
| 34 |
|
|---|
| 35 | macrospath=/home/operator/Mars.cvs/datacenter/macros
|
|---|
| 36 | cd /home/operator/Mars.cvs
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | datasetfiles=(`ls /magic/datasets/*/*`)
|
|---|
| 40 | echo "datasetfiles: "${datasetfiles[@]}
|
|---|
| 41 | echo ""
|
|---|
| 42 |
|
|---|
| 43 | for datasetfile in ${datasetfiles[@]}
|
|---|
| 44 | do
|
|---|
| 45 | no=`echo $datasetfile | cut -d/ -f5 | cut -c8-99 | cut -d. -f1`
|
|---|
| 46 | no2=`grep 'AnalysisNumber:' $datasetfile | sed -e 's/AnalysisNumber://g' | sed -e 's/ //g'`
|
|---|
| 47 | no3=`printf %08d $no2`
|
|---|
| 48 | if [ "$no" = "$no3" ]
|
|---|
| 49 | then
|
|---|
| 50 | echo "number in filename and in file are the same -> continue"
|
|---|
| 51 | else
|
|---|
| 52 | echo "number in filename and in file are not the same "
|
|---|
| 53 | echo " -> continue with next dataset"
|
|---|
| 54 | continue
|
|---|
| 55 | fi
|
|---|
| 56 | source=`grep 'SourceName:' $datasetfile | sed -e 's/SourceName://g' | sed -e 's/ //g' | sed -e 's/#//g'`
|
|---|
| 57 | mode=`grep 'WobbleMode:' $datasetfile`
|
|---|
| 58 | mode2=`echo $mode | grep ^\#`
|
|---|
| 59 | if [ "$mode2" = "" ]
|
|---|
| 60 | then
|
|---|
| 61 | wobble="Y"
|
|---|
| 62 | else
|
|---|
| 63 | wobble="N"
|
|---|
| 64 | fi
|
|---|
| 65 | echo "file: "$datasetfile
|
|---|
| 66 | echo " datasetno: "$no2
|
|---|
| 67 | echo " sourcename: "$source
|
|---|
| 68 | echo " wobble: "$wobble
|
|---|
| 69 | echo " "
|
|---|
| 70 | # check0=`root -q -b $macrospath/insertdataset.C+\("\"$no\""\,"\"$source\""\,"\"$type\""\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
|
|---|
| 71 | check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\"",kFALSE\) | grep int | sed -e 's/(int)//'`
|
|---|
| 72 | case $check0 in
|
|---|
| 73 | 1) echo "check0=$check0 -> everthing ok ";;
|
|---|
| 74 | *) echo "check0=$check0 -> ERROR ";;
|
|---|
| 75 | esac
|
|---|
| 76 | done
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|