-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSACST_dc_psv_nmodel.m
102 lines (81 loc) · 2.44 KB
/
SACST_dc_psv_nmodel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
function [REDsu,m1,Esu1,m0,Esu0] = SACST_dc_psv_nmodel(...
sacst,... % sac data
t0,t1,fs,... % time window for downward continuation
nlyr,nmod,vp,vs,rho,thik,... % earth models
sachd_rayp) % sac head field for ray parameter
%downward continuate surface plane wavefield through earth models
%output wave vectors in the first/last layer(m0,m1), and
%Su energy reduction ratio 1-Esu1/Esu0;
%size(vp) = [nlyr,nmod]; %same for vs,rho,thik
%size(m1) = [4*nevt,nt,nmod]; %same for m0
%% parameters
%sac
% sacdir = 'sac/';
% saclst = [sacdir,'evt.lst'];
% cmpnm = {'.BHR','.BHZ'};
%time samples
% t0 = -5;
% t1 = 10;
% fs = 20;
%Earth model (ice/bedrock)
% vp = [3.87 5.8]; % km/s
% vs = [1.95 3.46]; % km/s
% rho = [0.917 2.72]; % g/cm^3
% thik = [35 0]; % km
% nlyr = 2;
%thickness of ice sheet
% z = 1:0.1:5;
% sachd_rayp = 'user0';
%% load data
%load sac files
% sacst = SACST_fread('list',saclst,'prefix',sacdir,'suffix',cmpnm);
%time window cut
dt = 1/fs;
t = t0:dt:t1;
sacst = SACST_interp(sacst,t,'ref','0','rmnan',1);
%get ray parameters
str_cmd = sprintf('[sacst(:,1).%s]',sachd_rayp);
rayp = eval(str_cmd);
%% downward continuate the surface wavefield
nevt = size(sacst,1);
nt = length(t);
v0 = zeros(4,nt);
m0 = zeros(4*nevt,nt,nmod);
m1 = m0;
for ievt = 1:nevt
%state vector on the surface
v0(1,:) = sacst(ievt,1).data;
v0(2,:) = -1*sacst(ievt,2).data; %downward positive
%mode vector in the ice/bedrock
idx4_evt = 4*(ievt-1)+(1:4);
for imod = 1:nmod
[mm1,mm0] = dc_psv(...
nlyr,vp(:,imod),vs(:,imod),rho(:,imod),thik(:,imod),... % earth model
nt,v0,fs,... % time samples of velocity-stress vector
rayp(ievt)); % ray parameter
m1(idx4_evt,:,imod) = mm1;
m0(idx4_evt,:,imod) = mm0;
end
end
%% calculate Su energy reduction ratio
Esu0 = zeros(nevt,nmod);
Esu1 = Esu0;
for ievt = 1:nevt
%coef. from wave vector to energy
%first layer
qs0 = sqrt(vs(1)^-2-rayp(ievt)^2);
coef0 = rho(1)*vs(1)^2*qs0;
%last layer
qs1 = sqrt(vs(nlyr)^-2-rayp(ievt)^2);
coef1 = rho(nlyr)*vs(nlyr)^2*qs1;
idx0 = 4*(ievt-1);
for imod = 1:nmod
Su0 = m0(idx0+4,:,imod);
Esu0(ievt,imod) = coef0*sum(Su0.^2);
Su1 = m1(idx0+4,:,imod);
Esu1(ievt,imod) = coef1*sum(Su1.^2);
end
end
%Su energy reduction ratio
REDsu = 1-Esu1./Esu0;
end