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>]"\
22 "\nAuxiliary script to initialise environment for acoustics data processing."
26 fatal
"Wrong number of arguments."
29 if (( $# == 1 )) && [[
"$1" !=
"--" ]] ;
then
33 # Locally install input files.
37 for KEY
in sound_velocity tripod waveform hydrophone mechanics acoustics_trigger_parameters acoustics_fit_parameters disable;
do
39 if [[ ! -
f $ACOUSTICS_WORKDIR/${KEY}.txt ]];
then
43 ERRORS+=($ACOUSTICS_WORKDIR/${KEY}.txt)
48 if (( ${#ERRORS} != 0 ));
then
49 error
"There are missing input files for detector identifier $ID"\
50 "\nYou can use $script with one of the existing detector identifiers: "`ls
$JPP_LIB/${KEY}_*.txt | sed
's/.*_0*\([^0][0-9]*\).txt/\1/'`\
51 "\nand accordingly update files:\n ${ERRORS[*]}"
58 # Method write tripod data from given file into associative array.
61 # \param 2 associative array
63 function get_tripods()
65 set_local_variable __FILE__ $1
66 set_local_variable __ARRAY__ $2
70 if [[ -
n "$__line__" &&
"$__line__" != \#* ]];
then
72 echo $__line__ |
read __id__ __x__ __y__ __z__
74 eval ${__ARRAY__}\[${__id__}\]=\
"$__x__ $__y__ $__z__\"
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then usage $script< directory A >< directoryB > nIn each there should be a file detector datx and tripod txt
o $QUALITY_ROOT d $DEBUG!JPlot1D f
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
set_variable NUMBER_OF_ITERATIONS set_variable EPSILON cat acoustics_fit_parameters txt<< EOF $CONFIGURATION[*]Nmin=3;sigma_s=100.0e-6;stdev=10.0;mestimator=0;fixStrings=0;EOF for STRING in $STRINGS[*];do#fit stretching and(z) position of given string set_variable DETECTOR_TMP ${TMPDIR:-/tmp}/detector_A.datx JEditDetector-a $DETECTOR-o $DETECTOR_TMP-r $STRING JEditDetector-a $DETECTOR-o $DETECTOR-k $STRING for MUL in 0.005 0.001;do DX_M=0.2 for((N=0;$N< $NUMBER_OF_ITERATIONS;++N));do CHI2[3]=$CHI2[1] fitPositionOfString $STRING Z $DX_M fitStretchingOfString $STRING $MUL if(($CHI2[3]-$CHI2[1]< $EPSILON));then break fi done if(($N >=$NUMBER_OF_ITERATIONS));then printf"warning: reached maximum number of iterations %d - converenge %7.3f\n"$N $(($CHI2[3]-$CHI2[1])) fi done JMergeDetector-a $DETECTOR-a $DETECTOR_TMP-o $DETECTOR rm-f $DETECTOR_TMP JConvertDetectorFormat-a $DETECTOR-o $DETECTOR-r-d 0 > &dev null done
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