#!/bin/sh # this is # ---------------------------------------------------------------------------- # # Copyright (c) 2016 by Thomas Forbriger (BFO Schiltach) # # run calex and display results # # ---- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # ---- # # REVISIONS and CHANGES # 11/10/2016 V1.0 Thomas Forbriger # # ============================================================================ # # # indicate version VERSION=2016-10-18 # # ============================================================================ # **** define usage functions **** # ============================================================================ # usage() { cat >&2 << HERE usage: calex.sh [-v|--verbose] [-D|--debug] [-d|--device dev] [file] or: calex.sh --help|-h HERE } # # ---------------------------------------------------------------------------- # longusage() { cat >&2 <&2 echo >&2 "ERROR: command line parameters are incorrect!" echo >&2 "aborting $0..."; exit 2 } eval set -- "$TEMP" # # extract command line options # ---------------------------- VERBOSE=0 DEVICE=x11 PARAFILE=calex.par OUTBASE=NSP UNITS="counts" 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;; --debug) set -x ;; *) echo >&2 "ERROR: option $1 unprocessed!"; echo >&2 "aborting $0..."; exit 2;; esac shift done # # find parameter file # ------------------- if test $# -gt 0 then PARAFILE=$1 fi if test ! -r $PARAFILE then echo >&2 "Missing parameter file $PARAFILE" echo >&2 "aborting..." exit 2 fi echo using parameter file $PARAFILE COMMENT="$(head -n 1 $PARAFILE)" if test "$OUTBASE" = NSP then OUTBASE=$(basename $PARAFILE .par) fi calex $PARAFILE # generate result plot stuploxx --dev=${OUTBASE}_signals.ps/cps \ -title="${COMMENT}" \ -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" \ calex.ausf p:2 ci:1 sf:1.1 f:seife:date=${DATE} u:${UNITS} \ n:"output of seismometer" \ calex.synt p:3 ci:4 sf:1.1 f:seife:date=${DATE} u:${UNITS} \ n:"simulated output" \ calex.rest p:4 ci:2 sf:1.1 f:seife:date=${DATE} u:${UNITS} \ n:"residual" \ calex.ausf p:5 ci:1 sf:1.1 f:seife:date=${DATE} u:${UNITS} \ n:"output of seismometer" \ calex.synt p:5 ci:4 sf:1.1 f:seife:date=${DATE} u:${UNITS} \ n:"simulated output" \ calex.rest p:5 ci:2 sf:1.1 f:seife:date=${DATE} u:${UNITS} \ n:"residual" # result data calexoutextract.awk -v INI=8 ${OUTBASE}.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 \ ${OUTBASE}_signals.ps # ----- END OF calex.sh -----