| 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 |
|
|---|
| 35 | user=`whoami`
|
|---|
| 36 | program=makecallistolinks
|
|---|
| 37 | source /home/$user/Mars/datacenter/scripts/sourcefile
|
|---|
| 38 |
|
|---|
| 39 | set -C
|
|---|
| 40 |
|
|---|
| 41 | callistorcseq=callisto.rc
|
|---|
| 42 | callistorcnew=callisto_Dec04Jan05.rc
|
|---|
| 43 |
|
|---|
| 44 | scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d`
|
|---|
| 45 | makedir $scriptlogpath
|
|---|
| 46 | scriptlog=$scriptlogpath/$program`date +%F`.log
|
|---|
| 47 |
|
|---|
| 48 | date >> $scriptlog 2>&1
|
|---|
| 49 |
|
|---|
| 50 | # check if script is already running
|
|---|
| 51 | lockfile=$lockpath/lock-$program.txt
|
|---|
| 52 | checklock >> $scriptlog 2>&1
|
|---|
| 53 |
|
|---|
| 54 | # reason why calibration with standard callisto.rc fails
|
|---|
| 55 | reason="Pulse is too much to the right, cannot go beyond logain limits!"
|
|---|
| 56 | echo "reason: "$reason >> $scriptlog 2>&1
|
|---|
| 57 |
|
|---|
| 58 | # find files containing reason
|
|---|
| 59 | files=`find $datapath/callisto/ -name callisto*.log`
|
|---|
| 60 |
|
|---|
| 61 | # make links for callisto.rc for which the callisto.log contains reason
|
|---|
| 62 | for file in $files
|
|---|
| 63 | do
|
|---|
| 64 | pulse=`cat $file | grep "$reason"` >> $scriptlog 2>&1
|
|---|
| 65 | if [ ! "$pulse" = "" ]
|
|---|
| 66 | then
|
|---|
| 67 | path=`dirname $file` >> $scriptlog 2>&1
|
|---|
| 68 | ln -vfs $setuppath/callisto/$callistorcnew $path/$callistorcseq >> $scriptlog 2>&1
|
|---|
| 69 | fi
|
|---|
| 70 | done
|
|---|
| 71 |
|
|---|
| 72 | rm -v $lockfile >> $scriptlog 2>&1
|
|---|
| 73 |
|
|---|
| 74 | set +C
|
|---|
| 75 |
|
|---|
| 76 | date >> $scriptlog 2>&1
|
|---|
| 77 |
|
|---|