picksetup2 - CShell Script
phasepick2 - CShell Script
(This pair goes together)
picksetup2
Comments
#!/bin/csh -f

#    picksetup2   10/09/00  C.A. Langston

#    This script facilitates phase picking on data and synthetics
#       for use in the phase time program for earth structure.
#       Based on picksetup cshell

if ($#argv != 5) then
    echo "Input the model directory numbers for the following:"
    echo "reference model, v1 perturbation, v2 perturbation, sigmc perturbation, crustal thickness perturbation"
    echo "Usage:  $0 {ref# v1# v2# sigc# cth#}"
    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 PHASE '/space/langston/ts3/Tanzania/kint/phaseinv'
setenv RUKDAT '/space/langston/ts0/JSP/TzRukwa/sac'
#
#  This was for generating a synthetic data set to test the
#  inversion algorithm in Matlab
#  
#setenv RUKDAT '/space/langston/ts3/Tanzania/kint/models/synthdata'
#
#   Find data seismogram of interest

cd $RUKDAT
echo "choose data seismogram by copying name:"
echo " "
ls *.d.* 
echo " "

echo -n "Paste in the name:"
set dname = `gets`
echo $dname

#  Get reference model seismogram

if ($dname =~ *[z]) then
 set cmptyp = "z"
 else
endif
if ($dname =~ *[r]) then
 set cmptyp = "r"
 else
endif

if ($dname =~ *[t]) then
 set cmptyp = "t"
 else
endif

if($dname =~ "mtan"*) then
 set refname = "ruk."$cmptyp".001.107"
 else
endif

if($dname =~ "rung"*) then
 set refname = "ruk."$cmptyp".002.074"
 else
endif

if($dname =~ "tund"*) then
 set refname = "ruk."$cmptyp".003.151"
 else
endif

if($dname =~ "pand"*) then
 set refname = "ruk."$cmptyp".004.136"
 else
endif

if($dname =~ "uram"*) then
 set refname = "ruk."$cmptyp".005.008"
 else
endif

if($dname =~ "inza"*) then
 set refname = "ruk."$cmptyp".006.329"
 else
endif

if($dname =~ "mitu"*) then
 set refname = "ruk."$cmptyp".007.058"
 else
endif

if($dname =~ "puge"*) then
 set refname = "ruk."$cmptyp".008.027"
 else
endif

if($dname =~ "goma"*) then
 set refname = "ruk."$cmptyp".009.321"
 else
endif

if($dname =~ "mbwe"*) then
 set refname = "ruk."$cmptyp".010.046"
 else
endif

if($dname =~ "sing"*) then
 set refname = "ruk."$cmptyp".011.047"
 else
endif

if($dname =~ "mtor"*) then
 set refname = "ruk."$cmptyp".012.059"
 else
endif

if($dname =~ "baso"*) then
 set refname = "ruk."$cmptyp".013.047"
 else
endif

if($dname =~ "kond"*) then
 set refname = "ruk."$cmptyp".014.058"
 else
endif

if($dname =~ "kiba"*) then
 set refname = "ruk."$cmptyp".015.066"
 else
endif

if($dname =~ "tara"*) then
 set refname = "ruk."$cmptyp".016.050"
 else
endif

if($dname =~ "kibe"*) then
 set refname = "ruk."$cmptyp".017.070"
 else
endif

if($dname =~ "komo"*) then
 set refname = "ruk."$cmptyp".018.054"
 else
endif

if($dname =~ "long"*) then
 set refname = "ruk."$cmptyp".019.046"
 else
endif

if($dname =~ "hale"*) then
 set refname = "ruk."$cmptyp".020.073"
 else
endif

echo "Copy name for reference model seismogram:"
echo " "

setenv REFDIR $MODEL/"mod"$1
setenv PERDIR1 $MODEL/"mod"$2
setenv PERDIR2 $MODEL/"mod"$3
setenv PERDIR3 $MODEL/"mod"$4
setenv PERDIR4 $MODEL/"mod"$5

#  have data and synthetic seismogram names at this point

#  Set up SAC macro file for reading data and synthetic files
#      

cd $PHASE

echo "r " $RUKDAT"/"$dname > pick.macro
echo "r more "  $REFDIR"/"$refname >> pick.macro
echo "r more "  $PERDIR1"/"$refname >> pick.macro
echo "r more "  $PERDIR2"/"$refname >> pick.macro
echo "r more "  $PERDIR3"/"$refname >> pick.macro
echo "r more "  $PERDIR4"/"$refname >> pick.macro

echo "qdp off"  >> pick.macro

#  Set up picking window

echo "bd x"  >> pick.macro
echo "ppk savelocs on"  >> pick.macro

#   Setup some blackboard variables for gftype and phase picks
#   ylocn - amplitude measurements
#   xlocn - time measurements
#   nlocs - number of locations picked

echo 'sc echo "'$dname' %xloc1% %xloc2% %xloc3% %xloc4% %xloc5% %xloc6%" >> time.picks'  >> pick.macro
echo "quit" >> pick.macro

#  File has been setup

echo "The sac macro has been built for this seismogram."
echo "Now run phasepick for each phase of interest on this data seismogram"

exit
 
 
 


 
 
 
 

five synthetic seismograms are going to be compared to a data seismogram
 
 
 
 
 
 

locate all the stuff that is needed
 
 
 
 
 
 

Matlab was used to actually perform the inversion
 
 
 
 
 

interactive cutting and pasting of filenames in a directory
 
 
 
 
 
 

figure out the filename of the reference model seismogram
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

There were 20 stations
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

"pick.macro" is being built.  Phasepick2 will use it.
 
 
 
 
 
 
 
 
 
 
 

These variables will contain the amplitude and time picks
 
 

Wow!  "echo" is being used to call "echo" within SAC via the pick.macro.  This confuses even me.  Note that the picks will go into a UNIX file called "time.picks".
 
 

Tell the user to run phasepick.


 

After all of this, phasepick2 is invoked.


 
 
phasepick2
Comments
#!/bin/csh -f

#    phasepick2   10/09/00  C.A. Langston
#    Based on phasepick cshell.

#    This script facilitates phase picking on data and synthetics
#       for use in the structure inversion program for Tanzania structure
#       Run for each phase you want to model

#    Run sac and get data into window

echo "Pick the data arrival of interest first"
echo "Then pick Corresponding Synthetic seismogram arrivals"
echo "in order of Refernence trace, Perturbation 1, etc..."
echo "These amplitude picks will be appended to file time.picks"

$SACDIR/bin/sac2000 < pick.macro

exit
 
 

All it does is to run SAC.  A graphics window comes up and you use ppk to pick times.

 



Return



last modified 3/06/01