source: trunk/MagicSoft/Mars/scripts/merppupdate@ 8486

Last change on this file since 8486 was 8486, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.2 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 05/2007 <mailto:dorner@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2007
23#
24#
25# ========================================================================
26#
27#
28#
29##############################################################################
30#
31# This script can be used to do the merppupdate for already calibrated data.
32#
33# You have to set the path, where your calibrated files are stored.
34#
35##############################################################################
36
37# to be set by the user:
38# the directory, where the *_Y_*-files of your calibration are stored
39outpath=
40
41calfiles=`find $outpath -name 20_*_Y_*_E.root`
42
43echo "calfiles: "$calfiles
44
45for calfile in ${calfiles[@]}
46do
47 echo "updating $calfile..."
48
49 merpplogpath=$outpath"/merpplogs"
50 if [ ! -d $merpplogpath ]
51 then
52 mkdir -pv $merpplogpath
53 if [ ! -d $merpplogpath ]
54 then
55 echo "could not make merpplogpath "$merpplogpath
56 exit
57 fi
58 fi
59
60 runno=`echo $calfile | cut -d_ -f2 | sed -e 's/^0//' | sed -e 's/^0//' | sed -e 's/^0//' `
61 date=`date --date \`basename $calfile | cut -d_ -f1\` +%Y/%m/%d`
62 ccfile=`find /magic/subsystemdata/cc/$date -name 20[0-2][0-9][01][0-9][0-3][0-9]_*${runno}_[PDCS]_*_S.rep`
63 cacofile=`find /magic/subsystemdata/caco/$date -name dc_20[0-2][0-9]_[01][0-9]_[0-3][0-9]_*${runno}_*.txt`
64 echo "runno: "$runno
65 echo "ccfile: "$ccfile
66 if [ "$ccfile" = "" ]
67 then
68 echo "no ccfile found for run "$runno
69 break
70 fi
71 if [ "$cacofile" = "" ]
72 then
73 echo "cacofile with no $runno not found" >> $scriptlog 2>&1
74 echo "finding cacofile..." >> $scriptlog 2>&1
75 for (( i = 0; i <= 10; i++ ))
76 do
77 newrun=`echo $runno - $i | bc`
78 cacofile=`find $cacopath -name *$newrun*`
79 if [ "$cacofile" = "" ]
80 then
81 if [ $i -eq 9 ]
82 then
83 echo "no cacofile found for runno $newrun in $cacopath" >> $scriptlog 2>&1
84 break 2
85 fi
86 continue
87 else
88 break
89 fi
90 done
91 fi
92 echo "cacofile: "$cacofile
93 ./merpp -u --log=$merpplogpath/merppccupdate$runno.log --runfile=$runno $ccfile $calfile
94 echo "./merpp -u --log=$merpplogpath/merppccupdate$runno.log --runfile=$runno $ccfile $calfile "
95
96 ./merpp -u --log=$merpplogpath/merppcacoupdate$runno.log --auto-time $cacofile $calfile
97 echo "./merpp -u --log=$merpplogpath/merppcacoupdate$runno.log --auto-time $cacofile $calfile "
98
99done
100
Note: See TracBrowser for help on using the repository browser.