source: trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets@ 7037

Last change on this file since 7037 was 7037, checked in by Daniela Dorner, 19 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.4 KB
Line 
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
29source /home/operator/Mars.cvs/datacenter/scripts/sourcefile
30
31set -C
32
33#cd $mars
34
35macrospath=/home/operator/Mars.cvs/datacenter/macros
36cd /home/operator/Mars.cvs
37
38
39datasetfiles=(`ls /magic/datasets/*/*`)
40echo "datasetfiles: "${datasetfiles[@]}
41echo ""
42
43for datasetfile in ${datasetfiles[@]}
44do
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
76done
77
78
Note: See TracBrowser for help on using the repository browser.