kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
Added r as attribute to Touchstone
rodzic
ec8eb79168
commit
b6d041e999
|
@ -113,7 +113,11 @@ class Touchstone:
|
|||
def s22data(self) -> list:
|
||||
return self.s("22")
|
||||
|
||||
def s(self, name: str):
|
||||
@property
|
||||
def r(self) -> int:
|
||||
return self.opts.resistance
|
||||
|
||||
def s(self, name: str) -> list:
|
||||
return self.sdata[Touchstone.FIELD_ORDER.index(name)]
|
||||
|
||||
def _parse_comments(self, fp) -> str:
|
||||
|
|
|
@ -61,6 +61,7 @@ class TestTouchstoneTouchstone(unittest.TestCase):
|
|||
self.assertEqual(str(ts.opts), "# HZ S RI R 50")
|
||||
self.assertEqual(len(ts.s11data), 1010)
|
||||
self.assertEqual(len(ts.s21data), 0)
|
||||
self.assertEqual(ts.r, 50)
|
||||
|
||||
ts = Touchstone("./test/data/valid.s2p")
|
||||
ts.load()
|
||||
|
|
Ładowanie…
Reference in New Issue