Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
acoustics-diff.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 # --------------------------------------------------------------------------------------------
5 #
6 # Auxiliary script to compare two pre-calibrations.
7 #
8 # --------------------------------------------------------------------------------------------
9 
10 if [ -z $JPP_DIR ]; then
11  echo "Variable JPP_DIR undefined."
12  exit
13 fi
14 
15 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16 
19 
20 if do_usage $*; then
21  usage "$script <directory> <directory>"
22 fi
23 
24 if (( $# != 2 )); then
25  fatal "Wrong number of arguments."
26 fi
27 
28 DIR=($1 $2)
29 
30 source JAcousticsToolkit.sh
31 
32 if (( 1 )); then
33 
34  FILE=detector_initial.datx
35 
36  echo -n "Comparing $FILE "
37 
38  JCompareDetector \
39  -a $DIR[1]/$FILE \
40  -b $DIR[2]/$FILE >& /dev/null
41 
42  if (( $? == 0)); then
43  echo "$GREEN OK $RESET"
44  else
45  echo "$RED differ $RESET"
46  fi
47 fi
48 
49 if (( 1 )); then
50 
51  for FILE in $ACOUSTICS_KEYS[*]; do
52 
53  if [[ $FILE == "tripod" ]]; then
54  FILE+="_initial"
55  fi
56 
57  FILE+=".txt"
58 
59  echo -n "Comparing $FILE"
60 
61  diff \
62  $DIR[1]/$FILE \
63  $DIR[2]/$FILE >& /dev/null
64 
65  if (( $? == 0)); then
66  echo "$GREEN OK $RESET"
67  else
68  echo "$RED differ $RESET"
69  fi
70  done
71 fi
72 
73 if (( 1 )); then
74 
75  for FILE in $DIR[1]/*_toashort.root; do
76 
77  echo -n "Comparing ${FILE:t} "
78 
79  JDiffToAshort \
80  -f ${FILE} \
81  -f ${FILE/$DIR[1]/$DIR[2]} >& /dev/null
82 
83  if (( $? == 0)); then
84  echo "$GREEN OK $RESET"
85  else
86  echo "$RED differ $RESET"
87  fi
88  done
89 fi
90 
91 if (( 1 )); then
92 
93  for FILE in $DIR[1]/*_event.root; do
94 
95  echo -n "Comparing ${FILE:t} "
96 
97  JDiffAcousticsEvent \
98  $OPTION \
99  -f ${FILE} \
100  -f ${FILE/$DIR[1]/$DIR[2]} >& /dev/null
101 
102  if (( $? == 0)); then
103  echo "$GREEN OK $RESET"
104  else
105  echo "$RED differ $RESET"
106  fi
107  done
108 fi
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
exit
Definition: JPizza.sh:36
then
Definition: datalogs.sh:31
then fatal Wrong number of arguments fi DIR
const int n
Definition: JPolint.hh:786
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
then JCalibrateToT a
Definition: JTuneHV.sh:113
* usage
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable TRIPOD $argv[2] set_variable TX $argv[3] set_variable TY $argv[4] if[[!-f $DETECTOR]]
Definition: JFootprint.sh:28
then for FILE in $ACOUSTICS_KEYS[*]
then FILE
then echo
Definition: JQAQC.sh:90
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
script
Definition: JAcoustics.sh:2
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62