-
Notifications
You must be signed in to change notification settings - Fork 0
/
srcdim2mw.m
127 lines (109 loc) · 4.67 KB
/
srcdim2mw.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
function [Mw, stats] = srcdim2mw(varargin)
% Estimates magnigtude (Mw) for given source dimension, either rupture length (km)
% or rupture area (sq. km)using the empirical earthquake source-scaling relations.
% If both rupture length and rupture area are provided, then the magnitude
% is estimated based on rupture area.
%
% SYNTAX
% [L, W, stats] = Mw2SrcDim(...,'ParameterName',ParameterValue,...)
%
% LIST of PARAMETERNAMES
% Length - Rupture length (in km)
%
% Area - Rupture Area (in sq. km)
%
% fault - faulting type/style.
% ParameterValue can be one of the following:
% 'strike-slip', 'reverse', 'normal'
%
% regime - seimogenic regime.
% ParameterValue can be one of the following:
% 'crustal', 'interface'
% Interface refers to subduction interface.
% Also see: "How to implement scaling relations
% from other authors" in Additional notes.
%
% The above input parameters are mandatory. Optional ones are:
% Author - a unique shorthand for the authors
% Example: 'Author', 'TMG2017'
% This explicitly specify that the relations of
% Thingbaijam, Mai and Goda(2017) be applied,
% which is default value.
%
% Also see: "How to implement scaling relations
% from other authors" in Additional notes.
%
% seismogenic_width - Set fixed (maximum) seismogenic width/s (in km).
% If this is array, its size should be same as Mw.
% Array can be used to account for uncertain
% seismogenic width.
% Seismogenic width (Wseis) is different from seismogenic
% depth (Zseis).Wseis = Zseis/sind(dipAn),
% where dipAn is fault-dip in degrees.
% Default value is set 6378 km.
%
% scale - This can be use to avoid random sampling.
% For example: 'scale', 'median'
% In this case, output stats is not set.
% Default value: 'random'
%
% OUTPUTS
% Mw - Moment Magnitude
% stats - A structure with field:
% medianMw: median magnitude (Mw)
% seed : seed used for random sampling
%
%
% REFERENCES
% Thingbaijam, K.K.S., and P.M. Mai, (2020). Notes on empirical earthquake
% source-scaling laws, Bulletin of Seismological Society America,
% under review
%
% Thingbaijam, K.K.S., P.M. Mai, and K. Goda (2017). New empirical earthquake
% source-scaling laws, Bulletin of Seismological Society America,
% 107, 2225–2246.
%
% WRITTEN by:
% Thingbaijam K.K.S (thingbaijam@gmail.com;
% Also, see https://github.com/thingbaijam/sceqsrc
%
% $ version 0.1 Dated: 04/2020
%
% If you find any error or have suggestion, please do not hesitate to
% drop me an email.
%
%
% DISCLAIMER
% This software is provided "as is" with no warranty expressed or implied.
%
% Additional notes:
% (1) The empirical source-scaling relations of Thingbaijam,Mai,and Goda (2017)
% are invariant under the interchange of variables, i.e.,
% y = f(x) and x = f(y).
% (2) How to implement scaling relations from other authors?
% You got to write the matlab function. The name should be a unique
% shorthand for the authors. TMG2017.m can be used a refernce template.
%
if isempty(varargin)
help srcdim2mw; return;
end
% defaults
options = struct('length', -1,'area', -1, 'fault','none', 'regime', 'none', ...
'author', 'TMG2017', 'seismogenic_width', 6378, 'scale', 'random', ....
'sliprate', nan, 'stressdrop', nan, 'seeds', nan);
addpath('utility');
% parse the input arguments
inparams = parse_inputs(varargin, options);
scfunc = inparams.author;
addpath(scfunc);
inparams.func = 'srcdim2mw';
if inparams.area<0
inparams = rmfield(inparams, 'area');
end
if inparams.length<0
inparams = rmfield(inparams, 'length');
end
outpar = feval(scfunc,inparams);
Mw = outpar.Mw;
stats = outpar.stats;
rmpath(scfunc, 'utility');