Jpp  18.0.0-rc.2
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 
18 
19 if do_usage $*; then
20  usage "$script <directory> <directory>"
21 fi
22 
23 if (( $# != 2 )); then
24  fatal "Wrong number of arguments."
25 fi
26 
27 DIR=($1 $2)
28 
29 source JAcousticsToolkit.sh
30 
31 if (( 1 )); then
32 
33  FILE=detector_initial.datx
34 
35  echo -n "Comparing $FILE "
36 
37  JCompareDetector \
38  -a $DIR[1]/$FILE \
39  -b $DIR[2]/$FILE >& /dev/null
40 
41  if (( $? == 0)); then
42  echo "$GREEN OK $RESET"
43  else
44  echo "$RED differ $RESET"
45  fi
46 fi
47 
48 if (( 1 )); then
49 
50  for FILE in $ACOUSTICS_KEYS[*]; do
51 
52  if [[ $FILE == "tripod" ]]; then
53  FILE+="_initial"
54  fi
55 
56  if [[ $FILE == "hydrophone" ]]; then
57  continue
58  fi
59 
60  FILE+=".txt"
61 
62  echo -n "Comparing $FILE"
63 
64  diff \
65  $DIR[1]/$FILE \
66  $DIR[2]/$FILE >& /dev/null
67 
68  if (( $? == 0)); then
69  echo "$GREEN OK $RESET"
70  else
71  echo "$RED differ $RESET"
72  fi
73  done
74 fi
75 
76 if (( 1 )); then
77 
78  for FILE in $DIR[1]/*_toashort.root; do
79 
80  echo -n "Comparing ${FILE:t} "
81 
82  JDiffToAshort \
83  -f ${FILE} \
84  -f ${FILE/$DIR[1]/$DIR[2]} >& /dev/null
85 
86  if (( $? == 0)); then
87  echo "$GREEN OK $RESET"
88  else
89  echo "$RED differ $RESET"
90  fi
91  done
92 fi
93 
94 if (( 1 )); then
95 
96  for FILE in $DIR[1]/*_event.root; do
97 
98  echo -n "Comparing ${FILE:t} "
99 
100  JDiffAcousticsEvent \
101  -f ${FILE} \
102  -f ${FILE/$DIR[1]/$DIR[2]} >& /dev/null
103 
104  if (( $? == 0)); then
105  echo "$GREEN OK $RESET"
106  else
107  echo "$RED differ $RESET"
108  fi
109  done
110 fi
exit
Definition: JPizza.sh:36
then fatal Wrong number of arguments fi DIR
then echo
const int n
Definition: JPolint.hh:697
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:116
* 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
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