Debian Codegraph @

skrf/data/__init__.py

raw symbols SCIP
1 """
2 data (:mod:`skrf.data`)
3 ========================================
4
5 This Package provides data to be used in examples and testcases.
6
7 Material Properties
8 -------------------
9 .. autosummary::
10 :toctree: generated/
11
12 materials
13
14 Example/Test Networks
15 ---------------------
16 .. autosummary::
17 :toctree: generated/
18
19 ring_slot
20 ring_slot_meas
21 line
22 tee
23 ind
24 open_2p
25 short_2p
26
27 """
28 from __future__ import annotations
29
30 import os
31 from typing import TYPE_CHECKING
32
33 from ..io.general import read
34 from ..network import Network
35
36 if TYPE_CHECKING:
37 from ..calibration import Calibration
38
39 pwd = os.path.dirname(os.path.abspath(__file__))
40
41 class StaticData:
42
43 @property
44 def ntwk1(self) -> Network:
45 return Network(os.path.join(pwd, 'ntwk1.s2p'))
46
47 @property
48 def line(self) -> Network:
49 """ 2-Port Network: 'line', 75.0-110.0 GHz, 201 pts, z0=[50.+0.j 50.+0.j] """
50 return Network(os.path.join(pwd, 'line.s2p'))
51
52 @property
53 def open_2p(self) -> Network:
54 """ 2-Port Network: 'open', 1000000000.0-10000000000.0 Hz, 10 pts, z0=[50.+0.j 50.+0.j] """
55 return Network(os.path.join(pwd, 'open.s2p'))
56
57 @property
58 def short_2p(self) -> Network:
59 """ 2-Port Network: 'short', 1000000000.0-10000000000.0 Hz, 10 pts, z0=[50.+0.j 50.+0.j] """
60 return Network(os.path.join(pwd, 'short.s2p'))
61
62 @property
63 def ind(self) -> Network:
64 """ Measured 1 nH series inductor (with parasitics) """
65 return Network(os.path.join(pwd, 'ind.s2p'))
66
67 @property
68 def ring_slot(self) -> Network:
69 """ 2-Port Network: 'ring slot', 75.0-110.0 GHz, 201 pts, z0=[50.+0.j 50.+0.j] """
70 return Network(os.path.join(pwd, 'ring slot.s2p'))
71
72 @property
73 def tee(self) -> Network:
74 """ 3-Port Network: 'tee', 330.0-500.0 GHz, 201 pts, z0=[50.+0.j 50.+0.j 50.+0.j] """
75 return Network(os.path.join(pwd, 'tee.s3p'))
76
77 @property
78 def ring_slot_meas(self) -> Network:
79 """ 1-Port Network: 'ring slot measured', 75.0-109.999999992 GHz, 101 pts, z0=[50.+0.j] """
80 return Network(os.path.join(pwd, 'ring slot measured.s1p'))
81
82 @property
83 def wr2p2_line(self) -> Network:
84 return Network(os.path.join(pwd, 'wr2p2,line.s2p'))
85
86 @property
87 def wr2p2_line1(self) -> Network:
88 return Network(os.path.join(pwd, 'wr2p2,line1.s2p'))
89
90 @property
91 def wr2p2_delayshort(self) -> Network:
92 return Network(os.path.join(pwd, 'wr2p2,delayshort.s1p'))
93
94 @property
95 def wr2p2_short(self) -> Network:
96 return Network(os.path.join(pwd, 'wr2p2,short.s1p'))
97
98 @property
99 def wr1p5_line(self) -> Network:
100 return Network(os.path.join(pwd, 'wr1p5,line.s2p'))
101
102 @property
103 def wr1p5_short(self) -> Network:
104 return Network(os.path.join(pwd, 'wr1p5,short.s1p'))
105
106 @property
107 def ro_1(self) -> Network:
108 return Network(os.path.join(pwd, 'ro,1.s1p'))
109
110 @property
111 def ro_2(self) -> Network:
112 return Network(os.path.join(pwd, 'ro,2.s1p'))
113
114 @property
115 def ro_3(self) -> Network:
116 return Network(os.path.join(pwd, 'ro,3.s1p'))
117
118 @property
119 def one_port_cal(self) -> Calibration:
120 return read(os.path.join(pwd, 'one_port.cal'), encoding='latin1')
121
122 _data = StaticData()
123
124 def __getattr__(name):
125 return getattr(_data, name)
126
127 #one_port_cal = read(os.path.join(pwd, 'one_port.cal'), encoding='latin1')
128
129 mpl_rc_fname = os.path.join(pwd, 'skrf.mplstyle')
130
131 # material database (taken from wikipedia)
132 materials = {
133 'copper': {
134 'resistivity(ohm*m)': 1.68e-8,
135 },
136 'aluminum': {
137 'resistivity(ohm*m)': 2.82e-8,
138 },
139 'gold': {
140 'resistivity(ohm*m)': 2.44e-8,
141 },
142 'lead': {
143 'resistivity(ohm*m)': 1/4.56e6, # from pozar appendix F
144 },
145 'steel(stainless)': {
146 'resistivity(ohm*m)': 1/1.1e6, # from pozar appendix F
147 },
148 'mylar': {
149 'relative permativity': 3.1,
150 'loss tangent': 500e-4,
151 },
152 'quartz': {
153 'relative permativity': 3.8,
154 'loss tangent': 1.5e-4,
155 },
156 'silicon': {
157 'relative permativity': 11.68,
158 'loss tangent': 8e-4,
159 },
160 'teflon': {
161 'relative permativity': 2.1,
162 'loss tangent': 5e-4,
163 },
164 'duroid 5880': {
165 'relative permativity': 2.25,
166 'loss tangent': 40e-4,
167 },
168 }
169 """
170 materials : Dictionary of materials properties
171 """
172
173 for k1,k2 in [
174 ('cu', 'copper'),
175 ('al', 'aluminum'),
176 ('au', 'gold')]:
177 materials[k1] = materials[k2]