-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCole_Cole_class.py
66 lines (50 loc) · 1.64 KB
/
Cole_Cole_class.py
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
class ColeCole:
# class for tissues
def __init__(self, list, index, n):
self.list = list
self.index = index
self.n = n
self.name = str(list[index][0])
self.epsilon_inf = float(list[index][1])
self.sigma0 = float(list[index][-1])
self.epsilon_n = ColeCole.epsilon(list, index, n)
self.tau_n = ColeCole.tau(list, index, n)
self.alpha_n = ColeCole.alpha(list, index, n)
def get_name(self):
return self.name
def get_sigma0(self):
return self.sigma0
def get_epsilon_inf(self):
return self.epsilon_inf
@classmethod
def epsilon(cls, list, index: int, n: int):
eps_n = []
for i in range(n):
eps_n.append(float(list[index][2 + i * 3]))
return eps_n
def get_epsilon(self):
return self.epsilon_n
@classmethod
def tau(cls, list, index: int, n: int):
tau_n = []
for i in range(n):
tau_n.append(float(list[index][3 + i * 3]) * 10 ** (-12 + 3 * i))
return tau_n
def get_tau(self):
return self.tau_n
@classmethod
def alpha(cls, list, index: int, n: int):
alpha_n = []
for i in range(n):
alpha_n.append(float(list[index][4 + i * 3]))
return alpha_n
def get_alpha(self):
return self.alpha_n
def get_all(self):
array = [self.name, self.epsilon_inf]
for i in range(len(self.get_tau())):
array.append(self.get_epsilon()[i])
array.append(self.get_tau()[i])
array.append(self.get_alpha()[i])
array.append(self.get_sigma0())
return array