4 # -------------------------------------------------------------------------------------------- 
    6 # Auxiliary script to derive the geometry of the D0ORCA011 (123) detector from other detectors. 
    8 # -------------------------------------------------------------------------------------------- 
   10 if [ -
z $JPP_DIR ]; 
then 
   11     echo "Variable JPP_DIR undefined." 
   15 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/
null 
   20     usage "$script <source directory A> <source directory B>"                           \
 
   21           "\nThe source directory A corresponds to a pre-calibrated D0ORCA010 detector."  \
 
   22           "\nThe source directory B corresponds to a pre-calibrated D1ORCA011 detector." 
   28     *)  fatal 
"Wrong number of arguments." 
   36 if [[ ! -
f $DETECTOR_A ]]; 
then 
   37     fatal 
"Missing pre-calibrated D0ORCA010 input detector file" 
   40 if [[ ! -
f $DETECTOR_B ]]; 
then 
   41     fatal 
"Missing pre-calibrated D1ORCA011 input detector file" 
   44 if [[ ! -
f $TRIPOD_B ]]; 
then 
   45     fatal 
"Missing pre-calibrated D1ORCA011 input tripod file" 
   48 # D1ORCA011 
detector striped of all the 
new strings wrt D0ORCA011 and 
ID of D0ORCA011 assigned
 
   51     -@ 
"id=$DETECTOR_ID"            \
 
   52     -
k "1 2 3 4 9 10 12 18 28"      \
 
   58     -
k "1 2 3 9 10 11 12 19"           \
 
   61 cat >tripod_tmp.txt<<EOF
 
   64 # D0ORCA010 
detector aligned with D1ORCA011 at the base level.
 
   68     -
a detector_tmp.datx               \
 
   75     -
a detector_tmp.datx               \
 
   82     -
a detector_tmp.datx               \
 
   91 rm -
f detector_tmp.datx
 
   93 echo "# $script"                           >  disable.txt
 
   94 grep -
E -
v "^#" $DIR_DETECTOR_A/disable.txt  >> disable.txt
 
   95 grep -
E -
v "^#" $DIR_DETECTOR_B/disable.txt  >> disable.txt
 
   98     -
f $DIR_DETECTOR_B/transmitter.txt \
 
   99     -
k "1 2 3 4 9 10 12 18 28"         \
 
  103     -
f $DIR_DETECTOR_A/transmitter.txt \
 
  105     -
o transmitter_tmp.txt
 
  109     -
f transmitter_tmp.txt \
 
  112 rm -
f transmitter_tmp.txt
 
  115     -
f $DIR_DETECTOR_B/hydrophone.txt  \
 
  116     -
k "1 2 3 4 9 10 12 18 28"         \
 
  120     -
f $DIR_DETECTOR_A/hydrophone.txt  \
 
  122     -
o hydrophone_tmp.txt
 
  126     -
f hydrophone_tmp.txt \
 
  129 rm -
f hydrophone_tmp.txt
 
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
 
static const JGeographicalLocation ORCA(42, 48, 06, 02)
 
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
 
then JLigier sh continue fi cat
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O SUMMARY JPrintDAQHeader f $INPUT_FILE read A DAQ_HEADER set_variable DETECTOR_ID
 
then usage $script< detector specific pre-calibration script >< option > nAuxiliary script to make scan of pre stretching of detector strings(see JEditDetector)." "\nPossible options
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DETECTOR_ID if do_usage *then usage $script< source directory A >< sourcedirectoryB > nThe source directory A corresponds to a pre calibrated D0ORCA010 detector nThe source directory B corresponds to a pre calibrated D1ORCA011 detector fi case set_variable DIR_DETECTOR_A
 
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
 
do grep(chi2\[.\]\|gradient\|string:\)" $INPUT_FILE > $WORKDIR/stage.txt awk 'BEGIN 
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
 
then usage $script[energy[distance[z of PMT]]] fi case set_variable z
 
then fatal The output file must have the wildcard in the e g root fi 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
 
then JHobbit a $DETECTOR f
 
do set_variable DETECTOR_TXT $WORKDIR detector
 
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
 
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null