#!/bin/sh
#
# set-3t-bandwidth (6 May 2003)
#
#     LCMgui assumes that the bandwidth at 3T is always 5000Hz.
# If this is not the case for your data, then you must set BW_3T to your 
# bandwidth (in Hz) in the following line:
#
BW_3T=5000.0
#
# where there is no white space on either side of the "=" above 
# (for example, BW_3T=2500.0)
#
# Then select set-3t-bandwidth as your Preprocessor (see LCModel manual).
#
#     Notes:
#     (1) For 1.5T data (which needs no correction), it will do nothing.  So, 
# this Preprocessor can be used for both cases.
#     (2) If you do not use this Preprocessor, then you can use the 
# "View/Edit Control Parameters" window to set DELTAT = 1/(bandwidth), but you 
# would have to do this for every analysis.
#
#     You should not have to read anything beyond this.
#****************************************************************************
#
#     Many checks for error conditions have been skipped below.
#
# IHZPPPM = field strength in MHz.
IHZPPPM=`awk '/^hzpppm=/{ printf("%d", int($2)) }' $1`
#
if [ $IHZPPPM -gt 110 ] 
then
    DELTAT=`echo "$BW_3T" | awk '{ printf("%.4e", 1 / $1) }'`
    echo "deltat= $DELTAT" >> $1
fi
exit 0
