Commit c2083552 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

calex [FEATURE]: calex.sh control script is operational and tested

parent 669d6e72
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# #
# #
# indicate version # indicate version
VERSION=2016-10-18 VERSION=2016-10-19
# #
# ============================================================================ # ============================================================================
# **** define usage functions **** # **** define usage functions ****
...@@ -37,10 +37,8 @@ VERSION=2016-10-18 ...@@ -37,10 +37,8 @@ VERSION=2016-10-18
# #
usage() { usage() {
cat >&2 << HERE cat >&2 << HERE
usage: calex.sh [-v|--verbose] [--debug] [-d|--device dev] usage: calex.sh [-v|--verbose] [--debug] [-D|--date date] [-u|--units units]
[-D|--date date] [-u|--units units] [-b|--outbase basename] [-b|--outbase basename] [-i|--iterations n] [file]
[-i|--iterations n]
[file]
or: calex.sh --help|-h or: calex.sh --help|-h
HERE HERE
} }
...@@ -51,7 +49,7 @@ longusage() { ...@@ -51,7 +49,7 @@ longusage() {
cat >&2 <<HERE cat >&2 <<HERE
Run calex with a given control file and produce a report on the results. Run calex with a given control file and produce a report on the results.
file calex control file file calex control file (optional; default: calex.par)
-v|--verbose report plot parameters to the terminal -v|--verbose report plot parameters to the terminal
-D|--date date set date of seife data -D|--date date set date of seife data
...@@ -59,10 +57,6 @@ Run calex with a given control file and produce a report on the results. ...@@ -59,10 +57,6 @@ Run calex with a given control file and produce a report on the results.
-b|--outbase basename set basename for output files -b|--outbase basename set basename for output files
-i|--iterations n set the number of iterations to be reported in the -i|--iterations n set the number of iterations to be reported in the
summary summary
-d|--device dev select other output device than graphics screen
e.g. use '-d plotfile.ps/ps' to plot into Postscript
file 'plotfile.ps'
run 'stuplox -help' for a list of output devices
The shell script expects the following programs/scripts to be installed: The shell script expects the following programs/scripts to be installed:
...@@ -95,10 +89,10 @@ eval set -- "$TEMP" ...@@ -95,10 +89,10 @@ eval set -- "$TEMP"
# extract command line options # extract command line options
# ---------------------------- # ----------------------------
VERBOSE=0 VERBOSE=0
DEVICE=x11
PARAFILE=calex.par PARAFILE=calex.par
OUTBASE=NSP OUTBASE=NSP
UNITS="counts" UNITS="counts"
NLINES=6
DATE="1970/01/01" DATE="1970/01/01"
while true; do while true; do
case "$1" in case "$1" in
...@@ -106,9 +100,9 @@ while true; do ...@@ -106,9 +100,9 @@ while true; do
--) shift; break;; --) shift; break;;
-v|--verbose) VERBOSE=1;; -v|--verbose) VERBOSE=1;;
-u|--units) UNITS="$2"; shift;; -u|--units) UNITS="$2"; shift;;
-d|--device) DEVICE="$2"; shift;;
-b|--outbase) OUTBASE="$2"; shift;; -b|--outbase) OUTBASE="$2"; shift;;
-D|--date) DATE="$2"; shift;; -D|--date) DATE="$2"; shift;;
-i|--iterations) NLINES="$2"; shift;;
--debug) set -x ;; --debug) set -x ;;
*) echo >&2 "ERROR: option $1 unprocessed!"; *) echo >&2 "ERROR: option $1 unprocessed!";
echo >&2 "aborting $0..."; exit 2;; echo >&2 "aborting $0..."; exit 2;;
...@@ -133,16 +127,17 @@ echo using parameter file $PARAFILE ...@@ -133,16 +127,17 @@ echo using parameter file $PARAFILE
COMMENT="$(head -n 1 $PARAFILE)" COMMENT="$(head -n 1 $PARAFILE)"
CALEXBASE=$(basename $PARAFILE .par)
if test "$OUTBASE" = NSP if test "$OUTBASE" = NSP
then then
OUTBASE=$(basename $PARAFILE .par) OUTBASE=${CALEXBASE}
fi fi
calex $PARAFILE calex $PARAFILE
# generate result plot # generate result plot
stuploxx --dev=${OUTBASE}_signals.ps/cps \ stuploxx --dev=${OUTBASE}_signals.ps/cps \
-title="${COMMENT}" \ -title="${COMMENT}" -tstitle=0.6 \
-labh=0.22 -labr -labe -labc -labu \ -labh=0.22 -labr -labe -labc -labu \
calex.einf p:1 ci:1 sf:1.1 f:seife:date=${DATE} u:${UNITS} \ calex.einf p:1 ci:1 sf:1.1 f:seife:date=${DATE} u:${UNITS} \
n:"signal proportional to current in calibration coil" \ n:"signal proportional to current in calibration coil" \
...@@ -160,12 +155,12 @@ stuploxx --dev=${OUTBASE}_signals.ps/cps \ ...@@ -160,12 +155,12 @@ stuploxx --dev=${OUTBASE}_signals.ps/cps \
n:"residual" n:"residual"
# result data # result data
calexoutextract.awk -v INI=8 ${OUTBASE}.out > ${OUTBASE}_summary.out calexoutextract.awk -v INI=${NLINES} ${CALEXBASE}.out > ${OUTBASE}_summary.out
a2ps -o ${OUTBASE}_summary.ps --center-title="${COMMENT}" ${OUTBASE}_summary.out a2ps -o ${OUTBASE}_summary.ps --center-title="${COMMENT}" ${OUTBASE}_summary.out
echo results are present in: echo results are present in:
ls -1 ${OUTBASE}.out ${OUTBASE}_summary.out ${OUTBASE}_summary.ps \ ls -1 ${CALEXBASE}.out ${OUTBASE}_summary.out ${OUTBASE}_summary.ps \
${OUTBASE}_signals.ps ${OUTBASE}_signals.ps
# ----- END OF calex.sh ----- # ----- END OF calex.sh -----
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment