Jpp  master_rocky
the software that should make you happy
archive-put-calibration.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 
11 set_variable: DEBUG ARCHIVE_DEBUG 2
12 set_variable: WORKDIR ARCHIVE_WORKDIR ${TMPDIR:-/tmp}/
13 
14 if do_usage $*; then
15  usage "$script <archive> <version> <directory>"\
16  "\nAuxiliary script to store pre-calibration results in archive."\
17  "\nThe directory corresponds to the location of the pre-calibration results."
18 fi
19 
20 if (( $# != 3 )); then
21  fatal "Wrong number of arguments."
22 fi
23 
24 set_variable ARCHIVE $argv[1]
25 set_variable VERSION $argv[2]
26 set_variable DIR $argv[3]
27 
28 source JAcousticsToolkit.sh
29 
30 set_variable DETECTOR $DIR/$ACOUSTICS_DETECTOR
31 
32 if [[ ! -f $DETECTOR ]]; then
33  fatal "Missing detector file $DETECTOR"
34 fi
35 
36 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
37 
38 RUNS=(1 99999999)
39 
40 for KEY in $ACOUSTICS_AUXS[*]; do
41  if [[ -f $DIR/$KEY.txt ]]; then
42  putFile.sh $DIR/${KEY}.txt $ARCHIVE $DETECTOR_ID $RUNS[1] $RUNS[2] $KEY $VERSION
43  else
44  fatal "Missing file $DIR/$KEY.txt"
45  fi
46 done
47 
48 archive-put-Detector.sh $ARCHIVE $VERSION detector $DETECTOR $RUNS[1] $RUNS[2]