source: trunk/DataCheck/QuickLook/RunGanymed.sh@ 17050

Last change on this file since 17050 was 16676, checked in by Daniela Dorner, 11 years ago
added checking of command line options to allow for usage of sge
  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2#
3
4source `dirname $0`/../Sourcefile.sh
5printprocesslog "INFO starting $0"
6
7# get and check variables
8if ! [ "$1" = "" ]
9then
10 dsfile=$1
11 ra=$2
12 dec=$3
13fi
14
15if [ "$dsfile" = "" ]
16then
17 echo "ERROR variable dsfile empty."
18 printprocesslog "ERROR variable dsfile empty."
19fi
20
21if [ "$ra" = "" ]
22then
23 echo "ERROR variable ra empty."
24 printprocesslog "ERROR variable ra empty."
25fi
26
27if [ "$dec" = "" ]
28then
29 echo "ERROR variable dec empty."
30 printprocesslog "ERROR variable dec empty."
31fi
32
33outpath=`dirname $dsfile | sed -e 's/datasets/ganymed/'`
34makedir $outpath
35
36dsnum=`basename $dsfile | sed -e 's/dataset//' -e 's/[.]txt//'`
37output=$outpath/$dsnum
38logfile=$output"-ganymed.log"
39
40#mars=/home/fact/SW.automatic.processing/Mars.svn.2013.04.29
41cd $mars
42
43
44# run ganymed
45printprocesslog "INFO starting ganymed.C for dataset "$dsfile
46#echo "INFO starting ganymed.C for dataset "$dsfile
47
48printprocesslog "INFO command: root -q -b fact/analysis/ganymed.C\("\"$dsfile\""\,"\"$output\""\,$ra\,$dec\) | tee $logfile | intgrep"
49check1=`root -q -b fact/analysis/ganymed.C\("\"$dsfile\""\,"\"$output\""\,$ra\,$dec\) | tee $logfile | intgrep`
50
51case $check1 in
52 0) printprocesslog "INFO ganymed.C was successful for dataset "$dsfile" ra "$ra" dec "$dec" (check1=$check1)"
53 ;;
54 *) printprocesslog "ERROR ganymed.C failed for dataset "$dsfile" ra "$ra" dec "$dec" (check1=$check1)"
55 ;;
56esac
57
58finish
59
Note: See TracBrowser for help on using the repository browser.