#!/bin/sh
set -x
#####
# script for processing IRIS Digital Data
#####
######
# shell script to make entries for the various command files
######
YEAR=2006 Change the following for the event. No spaces are permitted near the = sign
MO=05
DY=10
HR=02
MN=42
SEC=56
MSEC=300
LAT=52.71
LON=-169.24
DEP=56.0
MAG=6.3
#####
# No changes below here
#####
if [ -d ../GOOD ] Create the GOOD directory for review. Never change original data
then
echo GOOD exists
else
mkdir ../GOOD
fi
rdseed creates SAC files ending in .SAC. For each of the SAC files we get information
from the trace header on station name, component name, location, network, and sample
rate. We also use the sample rate to determine the bands for deconvolution. We place
the event locaiton into the trace header.
The IRIS command evalresp (included in CPS) is used to read the RESP file to prepare a
table of amplitude and phase resposne for the deconvolution.
The station files are then placed in the parallel directory called GOOD for quality
control review. At this point the traces are renamed. The trace file
2006.130.02.49.27.4852.IU.ULN.00.BHZ.R.SAC is placed in ../GOOD as ULNBHZ.S and
the deconvolved trace (meters/sec) is placed in ../GOOD as ULNBHZ.sac
for i in *.SAC
do
NET=`saclhdr -KNETWK $i`
KSTNM=`saclhdr -KSTNM $i`
KCMPNM=`saclhdr -KCMPNM $i`
LOC=`saclhdr -KHOLE $i`
DOY=`saclhdr -NZJDAY $i`
DELTA=`saclhdr -DELTA $i`
FHH=`echo $DELTA | awk '{print 0.40/$1}' `
FHL=`echo $DELTA | awk '{print 0.25/$1}' `
cp RESP.${NET}.${KSTNM}.${LOC}.${KCMPNM} resp
evalresp ${KSTNM} ${KCMPNM} ${YEAR} ${DOY} 0.001 ${FHH} 2049 -u 'vel' -f resp
gsac << EOF
r $i
ch EVLA $LAT EVLO $LON EVDP $DEP
ch O CAL $YEAR $MN $DY $HR $MN $SEC $MSEC
ch lovrok true
ch lcalda true
wh
rtr
w ../GOOD/${KSTNM}${KCMPNM}.S
transfer from eval subtype AMP.${NET}.${KSTNM}.${LOC}.${KCMPNM} \
PHASE.${NET}.${KSTNM}.${LOC}.${KCMPNM} TO NONE FREQLIMITS 0.005 0.01 ${FHL} ${FHH}
w ../GOOD/${KSTNM}${KCMPNM}.sac
quit
EOF
done
#SCRIPT FOR IRIS DATA