Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Heimann
grond
Commits
ef508ad2
Commit
ef508ad2
authored
Jun 13, 2017
by
Sebastian Heimann
Browse files
cmt: add possibility to constrain to dc mechanisms
parent
6c98a7ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cmt.py
View file @
ef508ad2
...
...
@@ -42,7 +42,8 @@ class CMTProblem(core.Problem):
ranges
=
Dict
.
T
(
String
.
T
(),
gf
.
Range
.
T
())
distance_min
=
Float
.
T
(
default
=
0.0
)
nbootstrap
=
Int
.
T
(
default
=
10
)
mt_type
=
StringChoice
.
T
(
default
=
'full'
,
choices
=
[
'full'
,
'deviatoric'
])
mt_type
=
StringChoice
.
T
(
default
=
'full'
,
choices
=
[
'full'
,
'deviatoric'
,
'dc'
])
def
unpack
(
self
,
x
):
d
=
self
.
parameter_dict
(
x
)
...
...
@@ -134,6 +135,10 @@ class CMTProblem(core.Problem):
m_iso
=
num
.
diag
([
trace_m
/
3.
,
trace_m
/
3.
,
trace_m
/
3.
])
m9
-=
m_iso
elif
self
.
mt_type
==
'dc'
:
mt
=
mtm
.
MomentTensor
(
m
=
m9
)
m9
=
mt
.
standard_decomposition
()[
1
][
2
]
m0_unscaled
=
math
.
sqrt
(
num
.
sum
(
m9
.
A
**
2
))
/
math
.
sqrt
(
2.
)
m9
/=
m0_unscaled
...
...
@@ -334,7 +339,7 @@ class CMTProblemConfig(core.ProblemConfig):
ranges
=
Dict
.
T
(
String
.
T
(),
gf
.
Range
.
T
())
distance_min
=
Float
.
T
(
default
=
0.0
)
nbootstrap
=
Int
.
T
(
default
=
10
)
mt_type
=
StringChoice
.
T
(
choices
=
[
'full'
,
'deviatoric'
])
mt_type
=
StringChoice
.
T
(
choices
=
[
'full'
,
'deviatoric'
,
'dc'
])
def
get_problem
(
self
,
event
,
targets
):
if
event
.
depth
is
None
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment