# This script should help you with fourier analysing your data.
# It calls four and displays the data on pipe 0
#
# help function (called with option -h)
#
_help() {
   echo This shell script should help you with fourier analysing your data.
   echo It calls four and displays the data on pipe 0
   echo Parameters:
   echo "pacfour   -h       prints this help"
   echo "pacfour spectrum   starts analysis on the specified spectrum"
   echo "pacfour            without parameters, asks for everything"
   echo "output goes to name.spc_f"
}
#
# start analysing command line
#
SPNAM=$1
if test $# -eq 0
   then
   _help
   echo
   echo "please type in the name of the spectrum"
   SPNAM=`line`
fi
if [ $SPNAM = -h ]
   then
   _help
   exit 
fi
#
# cut off spectrum after statistics is too bad
#
mspc ${SPNAM}_r -bel 400
#
# now do fourier analysis
#
four ${SPNAM}_r[1:400] -o ${SPNAM}_f -pc 2
#
# now clear screen and draw specra
#
pag
ash ${SPNAM}_r[1:400] -b -y -0.2 +y 0.2 -2
ash ${SPNAM}_f[1:100] -v -1
