-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSeismicIntensityMeasure.py
More file actions
48 lines (30 loc) · 1.16 KB
/
SeismicIntensityMeasure.py
File metadata and controls
48 lines (30 loc) · 1.16 KB
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
import numpy as np
import Units
def get_ROTDpp(disp1, disp2):
disp_X_Y = np.column_stack((disp1, disp2))
# Rotating the Spectra (Projections)
Rot_Matrix = np.zeros((2, 2))
Rot_Disp = np.zeros((180, 1))
for theta in range(0, 180, 1):
Rot_Matrix[0, 0] = np.cos(np.deg2rad(theta))
Rot_Matrix[0, 1] = np.sin(np.deg2rad(-theta))
Rot_Matrix[1, 0] = np.sin(np.deg2rad(theta))
Rot_Matrix[1, 1] = np.cos(np.deg2rad(theta))
Rot_Disp[theta, 0] = np.max(np.matmul(disp_X_Y, Rot_Matrix)[:, 0])
return Rot_Disp
def get_CumAbsVel(ground_acc, dt, factor):
CAV = np.cumsum(np.abs(ground_acc) * dt)
return CAV[-1] * factor
def get_AriasIntensity(ground_acc, dt, factor):
g = 981
AI = (np.pi / (2 * g)) * np.cumsum((np.abs(ground_acc) ** 2) * dt)
return AI[-1] * factor
def get_PGA(ground_acc, factor):
PGA = np.max(np.abs(ground_acc))
return PGA * factor
def get_PGV(ground_vel, factor):
PGV = np.max(np.abs(ground_vel))
return PGV * factor
def get_PGD(ground_disp, factor):
PGD = np.max(np.abs(ground_disp))
return PGD * factor