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 @@
#
#
# indicate version
VERSION=2016-10-18
VERSION=2016-10-19
#
# ============================================================================
# **** define usage functions ****
......@@ -37,10 +37,8 @@ VERSION=2016-10-18
#
usage() {
cat >&2 << HERE
usage: calex.sh [-v|--verbose] [--debug] [-d|--device dev]
[-D|--date date] [-u|--units units] [-b|--outbase basename]
[-i|--iterations n]
[file]
usage: calex.sh [-v|--verbose] [--debug] [-D|--date date] [-u|--units units]
[-b|--outbase basename] [-i|--iterations n] [file]
or: calex.sh --help|-h
HERE
}
......@@ -51,7 +49,7 @@ longusage() {
cat >&2 <<HERE
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
-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.
-b|--outbase basename set basename for output files
-i|--iterations n set the number of iterations to be reported in the
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:
......@@ -95,20 +89,20 @@ eval set -- "$TEMP"
# extract command line options
# ----------------------------
VERBOSE=0
DEVICE=x11
PARAFILE=calex.par
OUTBASE=NSP
UNITS="counts"
NLINES=6
DATE="1970/01/01"
while true; do
case "$1" in
--help|-h) longusage; exit 1;;
--) shift; break;;
-v|--verbose) VERBOSE=1;;
-u|--units) UNITS="$2"; shift;;
-d|--device) DEVICE="$2"; shift;;
-b|--outbase) OUTBASE="$2"; shift;;
-D|--date) DATE="$2"; shift;;
-v|--verbose) VERBOSE=1;;
-u|--units) UNITS="$2"; shift;;
-b|--outbase) OUTBASE="$2"; shift;;
-D|--date) DATE="$2"; shift;;
-i|--iterations) NLINES="$2"; shift;;
--debug) set -x ;;
*) echo >&2 "ERROR: option $1 unprocessed!";
echo >&2 "aborting $0..."; exit 2;;
......@@ -133,16 +127,17 @@ echo using parameter file $PARAFILE
COMMENT="$(head -n 1 $PARAFILE)"
CALEXBASE=$(basename $PARAFILE .par)
if test "$OUTBASE" = NSP
then
OUTBASE=$(basename $PARAFILE .par)
OUTBASE=${CALEXBASE}
fi
calex $PARAFILE
# generate result plot
stuploxx --dev=${OUTBASE}_signals.ps/cps \
-title="${COMMENT}" \
-title="${COMMENT}" -tstitle=0.6 \
-labh=0.22 -labr -labe -labc -labu \
calex.einf p:1 ci:1 sf:1.1 f:seife:date=${DATE} u:${UNITS} \
n:"signal proportional to current in calibration coil" \
......@@ -160,12 +155,12 @@ stuploxx --dev=${OUTBASE}_signals.ps/cps \
n:"residual"
# 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
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
# ----- 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