Skip to content

Commit e8d473f

Browse files
committed
init
0 parents  commit e8d473f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+26252
-0
lines changed

BIN/bin2sac

24.8 KB
Binary file not shown.

BIN/decon

37.7 KB
Binary file not shown.

BIN/fpsol.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#function to determine the strike, rake and dip from a dc moment tensor
2+
#(full and deviatoric moment tenors need to be decomposed first
3+
4+
import math
5+
import numpy as np
6+
7+
def fpsol(nu,u):
8+
9+
"""
10+
reads the vector normal and slip vector returning strike, rake, dip
11+
"""
12+
13+
14+
dip=np.arccos(-1*nu[2])
15+
if nu[0] ==0. and nu[1] == 0.:
16+
str=0.
17+
else:
18+
str=np.arctan2(-1*nu[0],nu[1])
19+
20+
21+
22+
sstr=np.sin(str)
23+
cstr=np.cos(str)
24+
sdip=np.sin(dip)
25+
cdip=np.cos(dip)
26+
27+
28+
if abs(sdip) > 0.:
29+
rake=np.arcsin(-1*u[2]/np.sin(dip));
30+
else:
31+
arg1=1.
32+
arg2=u[2]
33+
arg=np.sign(arg2)
34+
if arg < 0.:
35+
rake=np.pi
36+
else:
37+
rake=0.
38+
39+
slambda=np.sin(rake)
40+
cdsl=cdip*slambda
41+
42+
if abs(sstr) > abs(cstr):
43+
clambda=(u[1]+cdsl*cstr)/sstr
44+
else:
45+
clambda=(u[0]-cdsl*sstr)/cstr
46+
47+
if slambda == 0. and clambda == 0.:
48+
slip=0.
49+
else:
50+
slip=np.arctan2(slambda,clambda)
51+
52+
53+
if dip > np.pi/2:
54+
dip=np.pi-dip
55+
str=str+np.pi
56+
slip=2*np.pi-slip
57+
58+
if str < 0.:
59+
str=str+2*np.pi
60+
61+
if slip >= np.pi:
62+
slip=slip-2*np.pi;
63+
64+
65+
str=str*180/np.pi
66+
rake=slip*180/np.pi
67+
dip=dip*180/np.pi
68+
69+
return str, rake, dip

BIN/fromHelm

16 KB
Binary file not shown.

BIN/mkHelm

25.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)