#! /bin/csh
#
#Creates ascii data file for a station
#Assumes station and polezero file naming convention
set nslc = $1
set zfile = *.$nslc{Z}.*.p.SAC

sac << sacend
read *.$nslc?.*.p.SAC
cuterr fillz 
cut t0 -30 n 512
read
write over
sc mv $zfile tmp3
read
rot to gcp
write tmp2 tmp1
sc cp tmp3 $zfile
quit
sacend

sac2helm out=$nslc.data
\rm tmp?
