SAC
sac 安装
安装二进制包
$ tar -xvf sac-101.6a-linux_x86_64.tar.gz # 解压
$ sudo mv sac /usr/local # 安装
先安装依赖包
$ sudo apt update
$ sudo apt install libc6 libsm6 libice6 libxpm4 libx11-6
$ sudo apt install zlib1g libncurses5
sac头段变量
nzyear, nzjday, nzhour, nzmin, nzsec, nzmsec #absolute time in sac data.nzjday is number of day in one year
kzdate # come from the nzyear and nzjday, change nzjday to date of month
kztime #derive from the nzhour to nzmsec.
idep # units of seismograph.IDISP for displacement(nm),IVEL(velocity nm/s),IVOLTS(volt,units V),IACC(nm/s^2)
npts #number of data.
delta # smaple time
b e o # origin time of waveform. e for end time of waveform, o refernce time
evla, evlo, evel, evdp kevnm mag# latitude longitude,evelation, depth of event, name of event,magnitude
gcarc, dist, az, baz # gcarc great circle arc units degree. dist for distance in km. az for azimuth( from
North to epicenter to station vector. ) and baz.
knetwk, kstnm #name of network, name of station
stla, stlo, stel, stdp #station position
cmpaz, cmpinc, kcmpnm, kstcmp # kcmpnm name of component,BHZ,BHN,BHE
Tn# for time of phase
r *.sac
rmean
rtrend
qdp off
xlim -5 300 #read 5before p arrival-300 second
title on "MMMMMM"
xlabel on "Time,sec"
ylabel on "Digital Counts"
int #transfer to displacement
p
w *.disp
r *z *r
ppk p 2 #picking use Repick.pl to pick t1 time of small amount
wh #write over the header only
bg sgf #Begin device SAC Graphics File
p1 #plot to the sgf file f001.sgf
ed sgf
sgftops f001.sgf plot1.ps #convert sgf to ps fil
波形排序
sort header [ASCEND|DESCEND] [header [ASCEND|DESCEND]...] #header is parameter in head file
sac> r *.sac
sac> sort az
sac> ppk # p1 p 10
sac> r *.sac
sac> sort gcarc descend #distance descend sort
sac> ppk p 10
时区校正
SAC> r nykl.z # 读入数据
SAC> lh b e kzdate kztime # 查看头段信息
b = 1.999622e+02 # b=200
e = 1.600968e+03 # e=1600
kzdate = SEP 10 (254), 1984
kztime = 03:14:07.000
SAC> ch b (&1,b& - 8*3600) # 取b值,减去8小时,再赋值给b
SAC> lh
b = -2.860004e+04 # 此时b=200-8*3600=28600
e = -2.719903e+04
kzdate = SEP 10 (254), 1984 # 参考时间不变
kztime = 03:14:07.000
SAC> ch allt (0 - &1,b&) iztype IB # 将参考时间设置为文件起始时间
SAC> lh b e kzdate kztime
b = 0.000000e+00
e = 1.401006e+03
kzdate = SEP 09 (253), 1984 # 中国时间的9月10日3时
kztime = 19:17:26.963 # => 国际标准时间的9月9日19时
截取时间窗函数
cut #use cut before read sac data
cut B 10 400 #B means begin, E for end.
cut B N 1000 #1000 points after Begin
cut T0 10 30 #10s after T0 and 30s after T0
xlim time1 time2 #time window between t1 and t2, t1 can be negative.
rotate:
SAC> dg sub teleseis ntkl.[enz]
SAC> w ntkl.e ntkl.n ntkl.z
SAC> r ./ntkl.n ./ntkl.e
SAC> lh cmpinc cmpaz
FILE: ./ntkl.n - 1
--------------
cmpinc = 9.000000e+01
cmpaz = 0.000000e+00
FILE: ./ntkl.e - 2
--------------
cmpinc = 9.000000e+01
cmpaz = 9.000000e+01
SAC> rotate to gcp # 旋转到大圆路径
SAC> lh cmpinc cmpaz
FILE: ./ntkl.n - 1
--------------
cmpinc = 9.000000e+01
cmpaz = 2.440466e+01
FILE: ./ntkl.e - 2
--------------
cmpinc = 9.000000e+01
cmpaz = 1.144047e+02
SAC> w ntkl.r ntkl.t # 保存为R分量和T分量
读入两个水平分量时,读入的顺序不重要,不管是先读 N 分量还是先读 E 分量,旋转后始终是 R 分量在前,T 分量在后。