source: trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks@ 7470

Last change on this file since 7470 was 7460, checked in by Daniela Dorner, 19 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.7 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-2006
23#
24#
25# ========================================================================
26#
27# This script links a special callisto.rc for data, for which the
28# calibration with the standard callisto.rc failes.
29#
30# The sequences with failing calibration are searched by searching for the
31# reason of failure in the callisto.log Then the special callisto.rc is
32# linked to the directory of the sequence.
33#
34
35user=`whoami`
36source /home/$user/Mars/datacenter/scripts/sourcefile
37
38set -C
39
40callistorcseq=callisto.rc
41callistorcnew=callisto_Dec04Jan05.rc
42
43scriptlogpath=$logpath/run/makecallistolinks/`date +%Y/%m/%d`
44makedir $scriptlogpath
45scriptlog=$scriptlogpath/makingcallistolinks`date +%F`.log
46
47date >> $scriptlog 2>&1
48
49# check if script is already running
50lockfile=$lockpath/lock-making-callisto-links.txt
51date > $lockfile >> $scriptlog 2>&1
52checklock0=$?
53case $checklock0 in
54 0) echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
55 1) echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
56 echo "-> getting list for callisto is running -> exit" >> $scriptlog 2>&1
57 date >> $scriptlog 2>&1
58 exit;;
59 *) echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
60esac
61
62# reason why calibration with standard callisto.rc fails
63reason="Pulse is too much to the right, cannot go beyond logain limits!"
64echo "reason: "$reason >> $scriptlog 2>&1
65
66# find files containing reason
67files=`find $datapath/callisto -name callisto*.log`
68
69# make links for callisto.rc for which the callisto.log contains reason
70for file in $files
71do
72 pulse=`cat $file | grep "$reason"` >> $scriptlog 2>&1
73 if [ ! "$pulse" = "" ]
74 then
75 path=`dirname $file` >> $scriptlog 2>&1
76 ln -vfs $setuppath/callisto/$callistorcnew $path/$callistorcseq >> $scriptlog 2>&1
77 fi
78done
79
80rm -v $lockfile >> $scriptlog 2>&1
81
82set +C
83
84date >> $scriptlog 2>&1
85
Note: See TracBrowser for help on using the repository browser.