Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
detector-Zmul:run.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 if [ -z $JPP_DIR ]; then
5  echo "Variable JPP_DIR undefined."
6  exit
7 fi
8 
9 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10 
12 set_variable WORKDIR ${ACOUSTICS_WORKDIR:-./}
13 set_variable FIT ${ACOUSTICS_FIT:-2}
14 
15 if ( do_usage $* ); then
16  usage "$script <string identifier> <detector file> (input file)+"
17 fi
18 
19 if (( $# < 3 )); then
20  fatal "Wrong number of arguments."
21 fi
22 
25 set_array INPUT_FILES $argv[3,-1]
26 
27 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
28 eval `JPrintDetector -a $DETECTOR -O SUMMARY`
29 
30 set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"`
31 
32 source JAcoustics.sh $DETECTOR_ID
33 
34 if [[ -z "${STRINGS[(r)$STRING]}" ]]; then
35  fatal "Invalid string $STRING; "\
36  "possible values: ${STRINGS[*]}"
37 fi
38 
39 set_variable DETECTOR_TXT $WORKDIR/detectorzmul_${STRING}.txt
40 set_variable TMPDIR $WORKDIR/.$$
41 mkdir -p $TMPDIR
42 
43 for (( Z = -9.0; $Z <= +1.0; Z += 0.1 )); do
44  for (( MUL = -0.01; $MUL <= 0.03; MUL += 0.001 )); do
45 
46  rm -f $TMPDIR/detector.detx
47 
48  JEditDetector \
49  -a $DETECTOR \
50  -k "$STRING" \
51  -S "$STRING add 0.0 0.0 $Z" \
52  -S "$STRING mul $MUL" \
53  -M "$MODULE sub 0.0 0.0 $Z" \
54  -o $TMPDIR/detector.detx
55 
56  rm -f $TMPDIR/katoomba.root
57 
58  eval JKatoomba \
59  -a $TMPDIR/detector.detx \
60  -f \"$INPUT_FILES[*]\" \
61  -o $TMPDIR/katoomba.root \
62  -T `print_tripods` \
63  -V `print_velocity` \
64  -@ `make_equation PARAMETERS` \
65  -@ \"stdev = 50\" \
66  -@ \"mestimator = 1\" \
67  -F $FIT \
68  -u \
69  -d $DEBUG --!
70 
71  set_variable CHI2 `JPrintResult -f $TMPDIR/katoomba.root:chi2 -F "GetMean"`
72  set_variable RMS `JPrintResult -f $TMPDIR/katoomba.root:chi2 -F "GetRMS / sqrt(GetEntries)"`
73 
74  printf "%7.3f %7.3f %7.3f %7.4f\n" $Z $MUL $CHI2 $RMS >> $DETECTOR_TXT
75 
76  done
77 done
78 
79 rm -rf $TMPDIR
set_variable DETECTOR
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTOR_TXT $WORKDIR detectorzmul_
then fatal No sound hydrophone file $HYDROPHONE_TXT fi JGraph f $HYDROPHONE_TXT o $HYDROPHONE_ROOT sort gr k
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:74
then echo
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then fatal Not enough arguments fi set_variable DETECTOR $argv[1] INPUT_FILES
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable ACOUSTICS_DEBUG
Definition: JAcoustics.sh:17
*set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2,-2] set_variable OUTPUT_FILE $argv[-1]
Definition: JDomino.sh:39
do set_variable SIGMA_NS set_variable OUTLIERS set_variable OUTPUT_FILE matrix[${ALPHA_DEG}\deg\] root $JPP JMatrixNZ a $DETECTOR f $INPUT_FILE o $OUTPUT_FILE S
Definition: JMatrixNZ.sh:56
then JCalibrateToT a
Definition: JTuneHV.sh:103
then display $WORKDIR
Definition: plot-Domino.sh:127
do set_variable DETECTOR_TXT $WORKDIR detector
script
Definition: JAcoustics.sh:2
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62