data_model_plot - CShell Script
data_model_plot
Comments
#!/bin/csh -f

#          data_model_plot

#  build SAC macros and run SAC to construct three component
#  data and synthetic waveform comparisons
#  will create a plotfile for the station

#     C.A. Langston 10/31/00
 

if ($#argv != 4) then
    echo "Usage:  $0 { mod# stationame tstart tfin }"
    exit
endif

#  Environment for directory structure

setenv CHUCKBIN '/space/langston/ts3/bin'
setenv MODEL '/space/langston/ts3/Tanzania/kint/models'
setenv CSHELL '/space/langston/ts3/Tanzania/kint/cshells'
setenv SACMAC '/space/langston/ts3/Tanzania/kint/sacmacros'
setenv TRAVT '/space/langston/ts3/Tanzania/travelt'
setenv RUKDAT '/space/langston/ts0/JSP/TzRukwa/sac'

set MOD = "mod"$1
setenv MODDIR $MODEL/$MOD

#  make sure that the distance header variable is set in the model

cd $MODDIR
cp $SACMAC/datasynplot.macro .

#  Get reference model seismogram

set sname = `$CSHELL/filename.csh $2 z`

#  build the plot macro file

echo 'bd sgf' > datsyn.plot.macro
echo 'beginframe' >> datsyn.plot.macro
echo 'macro datasynplot.macro ' $2 $RUKDAT'/'$2'.d.z '$sname' 1 ' $3 $4  >> datsyn.plot.macro

set sname = `$CSHELL/filename.csh $2 r`

echo 'macro datasynplot.macro ' $2 $RUKDAT'/'$2'.d.r '$sname' 2 ' $3 $4  >> datsyn.plot.macro

set sname = `$CSHELL/filename.csh $2 t`

echo 'macro datasynplot.macro ' $2 $RUKDAT'/'$2'.d.t '$sname' 3 ' $3 $4  >> datsyn.plot.macro
echo 'endframe' >> datsyn.plot.macro
echo 'ed sgf' >> datsyn.plot.macro
echo 'quit' >> datsyn.plot.macro

$SACDIR/bin/sac2000 < datsyn.plot.macro

sgftops f001.sgf $2'.plot.ps' 1 y
lpr $2'.plot.ps'
 
 
 
 


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

The "echo" command in UNIX is invaluable in creating macro files
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Return



last modified 3/06/01