4 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/
null 
    8 set_array      
RUNS           1  99999999
 
   12     usage "$script <archive> <detector> <directory>"\
 
   13           "\nAuxiliary script to check auxiliary data in archive for a given detector."\
 
   14           "\nThe directory corresponds to the location of the input tables (see https://git.km3net.de/calibration/input_tables) "\
 
   15           "\nand the archive to auxiliary data (see https://git.km3net.de/auxiliary_data/jpp)." 
   18 if (( $# != 3 )); 
then 
   19     fatal 
"Wrong number of arguments." 
   30 let          
"DETECTOR_ID = `getDetector -D $DETECTOR -O int`" 
   33 # map name in input_data/data/ to name in auxiliary_data/jpp/ 
   38 BUFFER[baseAcousticBeacon]=transmitter
 
   39 BUFFER[hydrophones]=hydrophone
 
   43 # processing functions 
   47     grep -
E -
v "^#" $1  |  tail -
n+2  |  tr 
',' ' '   
   50 function typeout_tripod()
 
   55 function typeout_hydrophone()
 
   57     typeout  $1  |  
awk -
v DEGTORAD=0.017453293 
'{ $5 *= DEGTORAD; if ($2 != -1) { print $1, $2,     ($3 * -cos($5) + $4 * -sin($5)), ($3 * +sin($5) + $4 * -cos($5)), $6 }}' 
   60 function typeout_transmitter()
 
   62     typeout  $1  |  
awk -
v DEGTORAD=0.017453293 
'{ $6 *= DEGTORAD; if ($3 != -1) { print $1, $2, $3, ($4 * -cos($6) + $5 * -sin($6)), ($4 * +sin($6) + $5 * -cos($6)), $7 }}' 
   65 function typeout_waveform()
 
   71 # format aliases with given precision 
   73 alias format_tripod=
'awk "{ printf \"%2d %+12.${PRECISION}f %+12.${PRECISION}f %+9.${PRECISION}f\n\", \$1, \$2, \$3, \$4 }"' 
   74 alias format_transmitter=
'awk "{ printf \"%2d %3d %2d %7.${PRECISION}f %7.${PRECISION}f %7.${PRECISION}f\n\", \$1, \$2, \$3, \$4, \$5, \$6 }"' 
   75 alias format_hydrophone=
'awk "{ printf \"%2d %3d %7.${PRECISION}f %7.${PRECISION}f %7.${PRECISION}f\n\", \$1, \$2, \$3, \$4, \$5 }"' 
   76 alias format_waveform=
'awk "{ printf \"%3d  %d\n\", \$1, \$2 }"' 
   85     eval 
grep -
E  -
v \
"^#\"  $1  \|  $3  >  $WORKDIR/.A.txt 
   86     eval grep -E  -v \"^#\"  $2  \|  $3  >  $WORKDIR/.B.txt 
   88     diff   $WORKDIR/.A.txt  $WORKDIR/.B.txt; export RESULT=$? 
   89     rm -f  $WORKDIR/.A.txt  $WORKDIR/.B.txt 
   93 for KEY VALUE in ${(kv)BUFFER}; do 
   95     set_variable  INPUT_FILE  $DIR/data/$DETECTOR/${DETECTOR}_${KEY}.csv 
   97     if [[ -f $INPUT_FILE ]]; then 
   99         set_variable   PRECISION      4 
  101         eval  typeout_$VALUE   $INPUT_FILE  \|  format_$VALUE  >  $WORKDIR/${VALUE}.txt  
  103         rm -f  $WORKDIR/${VALUE}_A.txt 
  105         getFile.sh  $ARCHIVE  $DETECTOR_ID  $RUNS[1]  $VALUE  master  $WORKDIR/${VALUE}_A >& /dev/null 
  109         compare  $WORKDIR/${VALUE}_A.txt  $WORKDIR/${VALUE}.txt  format_$VALUE 
  111         if (( $RESULT == 0 )); then 
  112             echo "$GREEN 
OK $RESET
" 
  114             echo "$RED Alternative input 
file $WORKDIR/${VALUE}.txt. $RESET
" 
then usage $script< detector identifier >< startdate\"YYYY-MM-DDHH:MM:SS\"><finaldate\"YYYY-MM-DDHH:MM:SS\"><QA/QCfile> fi case set_variable QAQC_TXT $argv[4]
 
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
 
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
 
then usage else fatal Wrong number of arguments fi JCookie sh eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O CAN eval JPrintDetector a $DETECTOR O SUMMARY source JAcousticsToolkit sh expand_array RUNS for KEY in sound_velocity waveform
 
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation. 
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DETECTOR_ID set_array RUNS if do_usage *then usage $script< source directory > nThe source directory corresponds to a pre calibrated D0ARCA009 detector fi case set_variable DIR
 
then fatal Missing detector file $DETECTOR fi eval JPrintDetector a $DETECTOR O IDENTIFIER RUNS
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DIR $JPP_DIR examples JPhysics set_variable DEBUG set_variable darkcount_Hz set_variable rateL0_Hz set_array rateL1_Hz if do_usage *then usage $script[working directory] fi function typeout()
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR if do_usage *then usage $script[(input file)+] fi set_variable DEBUG set_variable WORKDIR TMPDIR
 
do grep(chi2\[.\]\|gradient\|string:\)" $INPUT_FILE > $WORKDIR/stage.txt awk 'BEGIN 
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
 
do set_variable STRING_TXT awk
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
 
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
 
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
 
do echo Generating $dir eval D
 
then getFile sh $JPP_ARCHIVE $DETECTOR_ID $RUNS[1] $KEY $VERSION $WORKDIR
 
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null