Introduction

This section discusses the script DOMKSYN in detail in order to let you know what the script actually does and also how you might modify the script

The Script

#!/bin/sh

#####
# create synthetics for each Z in the observed
# Syntax:
# DOMKSYN DIRBIG STK DIP RAKE HS MW
#####

#####
# test usage
#####
if [ $# != 6 ]
then
echo DOMKSYN DIRBIG STK DIP RAKE HS MW
echo you entered:
echo $*
exit 0
fi

#####
# define the internal parameters for the synthetic
#####

DIRBIG=$1
STK=$2
DIP=$3
RAKE=$4
HS=$5
MW=$6

if [ ! -d SYN ]
then
mkdir SYN
else
rm -fr SYN
mkdir SYN
fi

#####
# make synthetics
#####

for Ztrace in `ls ${DIRBIG}/*Z`
do

rm -fr *.[ZRT]

GCARC=`saclhdr -GCARC ${Ztrace} `
AZ=`saclhdr -AZ ${Ztrace}`
KSTNM=`saclhdr -KSTNM ${Ztrace}`
KCMPNM=`saclhdr -KCMPNM ${Ztrace}`

echo GCARC $GCARC AZ $AZ
MODEL=${GREENDIR}/Models/tak135sph.mod

hudson96 -TEL ${MODEL} -HS ${HS} -P -GCARC ${GCARC} -NPTS 2048 -DT 0.20
hpulse96 -p -V -l 4 | fmech96 -S ${STK} -D ${DIP} -R ${RAKE} -MW ${MW} -AZ ${AZ} -ROT | f96tosac -T
mv *.Z SYN/${KSTNM}${KCMPNM}

#####
# convert to m/s and set station component names
#####
gsac << EOF
r SYN/${KSTNM}${KCMPNM}
ch kstnm ${KSTNM}
ch kcmpnm ${KCMPNM}
div 100
w
q
EOF

done
      
This script will make a synthetic to match an observed trace.
The command syntax is given here. This script is called by the
DOITGRN script.

Note this is currently set up to make vertical component synthetics
using the program hudson96















Create a directory where synthetics are computed. This is mostly
to keep the organization clean







This is the top of the loop to make a forward synthetic for each
observed vertical (Z) trace.


Use saclhdr to get information from the trace so that we
can create the synthetic




Note that the DT = 0.20 sec. Also not that the source pulse, e.g.,
the '-l 4 ' flag means that the source wavelet will be
4 *4 * 0.2 = 3.2 seconds long in duration. Note that we are
creating velocity synthetics in units of cm/s

Here we give the synthetic the correct station and component name
We also divide the trace by 100 to convert the units to m/sec

Last changed August 17, 2009