Exemplo n.º 1
0
 def test_twostep(self):
     embedded = touchstone.read(data_dir + 'deemb_twostep.s2p')
     open = touchstone.read(data_dir + 'deemb_twostep_open.s2p')
     short = touchstone.read(data_dir + 'deemb_twostep_short.s2p')
     deembedder = TwoStep(open, short)
     deembedded = deembedder.deembed(embedded)
     touchstone.write(deembedded, data_dir + 'deemb_twostep_deembedded', 'MA')
     maxerror = self.error(deembedded)
     self.assertAlmostEqual(maxerror, 0, 4)
Exemplo n.º 2
0
 def test_twostep(self):
     embedded = touchstone.read(data_dir + 'deemb_twostep.s2p')
     open = touchstone.read(data_dir + 'deemb_twostep_open.s2p')
     short = touchstone.read(data_dir + 'deemb_twostep_short.s2p')
     deembedder = TwoStep(open, short)
     deembedded = deembedder.deembed(embedded)
     touchstone.write(deembedded, data_dir + 'deemb_twostep_deembedded',
                      'MA')
     maxerror = self.error(deembedded)
     self.assertAlmostEqual(maxerror, 0, 4)
Exemplo n.º 3
0
 def test_vandamme01(self):
     embedded = touchstone.read(data_dir + 'deemb_vandamme01.s2p')
     open = touchstone.read(data_dir + 'deemb_vandamme01_open.s2p')
     short1 = touchstone.read(data_dir + 'deemb_vandamme01_short1.s2p')
     short2 = touchstone.read(data_dir + 'deemb_vandamme01_short2.s2p')
     through = touchstone.read(data_dir + 'deemb_vandamme01_through.s2p')
     deembedder = Vandamme01(open, short1, short2, through)
     deembedded = deembedder.deembed(embedded)
     touchstone.write(deembedded, data_dir + 'deemb_vandamme01_deembedded', 'MA')
     maxerror = self.error(deembedded)
     self.assertAlmostEqual(maxerror, 0, 3)
Exemplo n.º 4
0
 def test_vandamme01(self):
     embedded = touchstone.read(data_dir + 'deemb_vandamme01.s2p')
     open = touchstone.read(data_dir + 'deemb_vandamme01_open.s2p')
     short1 = touchstone.read(data_dir + 'deemb_vandamme01_short1.s2p')
     short2 = touchstone.read(data_dir + 'deemb_vandamme01_short2.s2p')
     through = touchstone.read(data_dir + 'deemb_vandamme01_through.s2p')
     deembedder = Vandamme01(open, short1, short2, through)
     deembedded = deembedder.deembed(embedded)
     touchstone.write(deembedded, data_dir + 'deemb_vandamme01_deembedded',
                      'MA')
     maxerror = self.error(deembedded)
     self.assertAlmostEqual(maxerror, 0, 3)
Exemplo n.º 5
0
 def test(file_path):
     try:
         tstone = touchstone.read(file_path)
         del tstone
         return True
     except:
         return False
Exemplo n.º 6
0
    def _create_window(self):
        ts = touchstone.read("../tests/data/deemb_mom.s2p")
        ts = ts.recombine([1, 2])

        circles_source = np.vstack(ts.stability_circle_source()).T
        circles_load = np.vstack(ts.stability_circle_load()).T

        container = OverlayPlotContainer(padding=50, fill_padding=True, bgcolor="lightgray", use_backbuffer=True)

        self.data = ArrayPlotData(
            f=ts.freqs,
            s11=ts.get_parameter(1, 1),
            s12=ts.get_parameter(1, 2),
            s21=ts.get_parameter(2, 1),
            s22=ts.get_parameter(2, 2),
            circles_source=circles_source,
            circles_load=circles_load,
        )
        self.plot = SmithPlot(self.data, title="Smith plot")

        self.plot.plot(("f", "s11"), color="auto", line_width=2.0)
        self.plot.plot(("f", "s22"), color="auto", line_width=2.0)
        # self.plot.plot(("f", "s21"), color="auto", line_width=2.0)
        # self.plot.plot(("f", "s12"), color="auto", line_width=2.0)

        self.plot.plot_circle(("f", "circles_source"), color="auto", line_width=2.0)
        self.plot.plot_circle(("f", "circles_load"), color="auto", line_width=2.0)

        container.add(self.plot)

        self.plot.tools.append(PanTool(self.plot))
        zoom = SimpleZoom(self.plot, tool_mode="box", always_on=False)
        self.plot.overlays.append(zoom)

        return Window(self, -1, component=container)
Exemplo n.º 7
0
 def test(file_path):
     try:
         tstone = touchstone.read(file_path)
         del tstone
         return True
     except:
         return False
Exemplo n.º 8
0
 def setUp(self):
     # the device under test to be extracted using the deembedding techniques
     self.dut = touchstone.read(data_dir + 'deemb_dut.s2p')
     
     # 2-port parameters for the ADS Momentum tests
     self.mom_embedded = touchstone.read(data_dir + 'deemb_mom.s2p')
     self.mom_simple_open = touchstone.read(data_dir + 'deemb_mom_simple_open.s2p')
     self.mom_simple_short = touchstone.read(data_dir + 'deemb_mom_simple_short.s2p')
     self.mom_open = touchstone.read(data_dir + 'deemb_mom_open.s2p')
     self.mom_short = touchstone.read(data_dir + 'deemb_mom_short.s2p')
     self.mom_short1 = touchstone.read(data_dir + 'deemb_mom_short1.s2p')
     self.mom_short2 = touchstone.read(data_dir + 'deemb_mom_short2.s2p')
     self.mom_through = touchstone.read(data_dir + 'deemb_mom_through.s2p')
Exemplo n.º 9
0
    def setUp(self):
        # the device under test to be extracted using the deembedding techniques
        self.dut = touchstone.read(data_dir + 'deemb_dut.s2p')

        # 2-port parameters for the ADS Momentum tests
        self.mom_embedded = touchstone.read(data_dir + 'deemb_mom.s2p')
        self.mom_simple_open = touchstone.read(data_dir +
                                               'deemb_mom_simple_open.s2p')
        self.mom_simple_short = touchstone.read(data_dir +
                                                'deemb_mom_simple_short.s2p')
        self.mom_open = touchstone.read(data_dir + 'deemb_mom_open.s2p')
        self.mom_short = touchstone.read(data_dir + 'deemb_mom_short.s2p')
        self.mom_short1 = touchstone.read(data_dir + 'deemb_mom_short1.s2p')
        self.mom_short2 = touchstone.read(data_dir + 'deemb_mom_short2.s2p')
        self.mom_through = touchstone.read(data_dir + 'deemb_mom_through.s2p')
Exemplo n.º 10
0
 def test_kolding00(self):
     embedded = touchstone.read(data_dir + 'deemb_kolding00.s2p')
     simple_open = touchstone.read(data_dir + 'deemb_kolding00_simple_open.s2p')
     simple_short = touchstone.read(data_dir + 'deemb_kolding00_simple_short.s2p')
     open = touchstone.read(data_dir + 'deemb_kolding00_open.s2p')
     short1 = touchstone.read(data_dir + 'deemb_kolding00_short1.s2p')
     short2 = touchstone.read(data_dir + 'deemb_kolding00_short2.s2p')
     deembedder = Kolding00(simple_open, simple_short, open, short1, short2)
     deembedded = deembedder.deembed(embedded)
     touchstone.write(deembedded, data_dir + 'deemb_kolding00_deembedded', 'MA')
     maxerror = self.error(deembedded)
     self.assertAlmostEqual(maxerror, 0, 2)
Exemplo n.º 11
0
    def __init__(self, file_path):
        DataFile.__init__(self, file_path)
        self._touchstone = touchstone.read(self.file_path, True)
        self.rootItem = None

        # build hierarchical signal list
        self.circuit = Circuit("Touchstone", self)
        indep_name = "frequency"
        indep_type = signaltype.f
        indep_signal = Signal(indep_name, indep_name, None, indep_type)
        indep_signal._set_parent(self.circuit)
        for i in range(self._touchstone.ports):
            for j in range(self._touchstone.ports):
                signal_name = "S(%d,%d)" % (i + 1, j + 1)
                signal_type = signaltype.Spar
                signal = Signal(signal_name, signal_name, indep_signal, signal_type)
                signal._data_source_info['port1'] = i + 1
                signal._data_source_info['port2'] = j + 1
                self.circuit.add_signal(signal)
Exemplo n.º 12
0
    def __init__(self, file_path):
        DataFile.__init__(self, file_path)
        self._touchstone = touchstone.read(self.file_path, True)
        self.rootItem = None

        # build hierarchical signal list
        self.circuit = Circuit("Touchstone", self)
        indep_name = "frequency"
        indep_type = signaltype.f
        indep_signal = Signal(indep_name, indep_name, None, indep_type)
        indep_signal._set_parent(self.circuit)
        for i in range(self._touchstone.ports):
            for j in range(self._touchstone.ports):
                signal_name = "S(%d,%d)" % (i + 1, j + 1)
                signal_type = signaltype.Spar
                signal = Signal(signal_name, signal_name, indep_signal,
                                signal_type)
                signal._data_source_info['port1'] = i + 1
                signal._data_source_info['port2'] = j + 1
                self.circuit.add_signal(signal)
Exemplo n.º 13
0
 def test_kolding00(self):
     embedded = touchstone.read(data_dir + 'deemb_kolding00.s2p')
     simple_open = touchstone.read(data_dir +
                                   'deemb_kolding00_simple_open.s2p')
     simple_short = touchstone.read(data_dir +
                                    'deemb_kolding00_simple_short.s2p')
     open = touchstone.read(data_dir + 'deemb_kolding00_open.s2p')
     short1 = touchstone.read(data_dir + 'deemb_kolding00_short1.s2p')
     short2 = touchstone.read(data_dir + 'deemb_kolding00_short2.s2p')
     deembedder = Kolding00(simple_open, simple_short, open, short1, short2)
     deembedded = deembedder.deembed(embedded)
     touchstone.write(deembedded, data_dir + 'deemb_kolding00_deembedded',
                      'MA')
     maxerror = self.error(deembedded)
     self.assertAlmostEqual(maxerror, 0, 2)
Exemplo n.º 14
0
    def _create_window(self):
        ts = touchstone.read('tests/data/deemb_mom.s2p')
        freqs = ts.freqs
        s11 = ts.get_parameter(1 ,1)

        container = OverlayPlotContainer(padding=50, fill_padding=True,
                                         bgcolor="lightgray",
                                         use_backbuffer=True)

        plot = create_smith_plot((freqs, s11), color=(0.0, 0.0, 1.0, 1),
                                 width=2.0)
        plot.bgcolor = "white"
        container.add(plot)

        # Add the title at the top
        container.overlays.append(PlotLabel("Smith Chart",
                                  component=container,
                                  font = "swiss 16",
                                  overlay_position="top"))

        return Window(self, -1, component=container)
Exemplo n.º 15
0
    def _create_window(self):
        ts = touchstone.read('tests/data/deemb_mom.s2p')
        freqs = ts.freqs
        s11 = ts.get_parameter(1, 1)

        container = OverlayPlotContainer(padding=50,
                                         fill_padding=True,
                                         bgcolor="lightgray",
                                         use_backbuffer=True)

        plot = create_smith_plot((freqs, s11),
                                 color=(0.0, 0.0, 1.0, 1),
                                 width=2.0)
        plot.bgcolor = "white"
        container.add(plot)

        # Add the title at the top
        container.overlays.append(
            PlotLabel("Smith Chart",
                      component=container,
                      font="swiss 16",
                      overlay_position="top"))

        return Window(self, -1, component=container)