4 # ------------------------------------------------------------------------------------------
6 # Auxiliary script for configuration of acoustics scripts.
8 # ------------------------------------------------------------------------------------------
10 if [ -z $JPP_DIR ];
then
11 echo "Variable JPP_DIR undefined."
15 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/
null
21 usage "$script [<detector identifier>]"
25 fatal
"Wrong number of arguments."
28 if (( $# == 1 )) && [[
"$1" !=
"--" ]] ;
then
32 # Locally install input files.
36 for KEY
in sound_velocity tripod waveform hydrophone mechanics acoustics_trigger_parameters acoustics_fit_parameters;
do
38 if [[ ! -
f $ACOUSTICS_WORKDIR/${KEY}.txt ]];
then
40 cp $JPP_LIB/${KEY}_${(l:8::0::0:)ID}.txt $ACOUSTICS_WORKDIR/${KEY}.txt
42 ERRORS+=($ACOUSTICS_WORKDIR/${KEY}.txt)
47 if (( ${#ERRORS} != 0 ));
then
48 error
"There are missing input files for detector identifier $ID"\
49 "\nYou can use $script with one of the existing detector identifiers: "`ls
$JPP_LIB/${KEY}_*.txt | sed
's/.*_0*\([^0][0-9]*\).txt/\1/'`\
50 "\nand accordingly update files:\n ${ERRORS[*]}"
57 # Method write tripod data from given file into associative array.
60 # \param 2 associative array
62 function get_tripods()
64 set_local_variable __FILE__ $1
65 set_local_variable __ARRAY__ $2
69 if [[ -
n "$__line__" &&
"$__line__" != \#* ]];
then
71 echo $__line__ |
read __id__ __x__ __y__ __z__
73 eval ${__ARRAY__}\[${__id__}\]=\
"$__x__ $__y__ $__z__\"
bool read(Vec &v, std::istream &is)
Read a Vec(tor) from a stream.
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
alias put_queue eval echo n
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
then echo Monitoring data echo Detector