def setUp(self): self.n_ports = 2 self.wg = rf.RectangularWaveguide(rf.F(75,100,NPTS), a=100*rf.mil,z0=50) wg = self.wg self.Xf = wg.random(n_ports =2, name = 'Xf') self.Xr = wg.random(n_ports =2, name = 'Xr') self.Yf = wg.random(n_ports =2, name='Yf') self.Yr = wg.random(n_ports =2, name='Yr') ideals = [ wg.short(nports=2, name='short'), wg.open(nports=2, name='open'), wg.match(nports=2, name='load'), None, ] actuals = [ wg.short(nports=2, name='short'), wg.open(nports=2, name='open'), wg.match(nports=2, name='load'), wg.thru(), ] measured = [ self.measure(k) for k in actuals] self.cal = SOLT( ideals = ideals, measured = measured, n_thrus=1, )
def setUp(self): self.n_ports = 2 self.wg = WG wg = self.wg self.Xf = wg.random(n_ports=2, name='Xf') self.Xr = wg.random(n_ports=2, name='Xr') self.Yf = wg.random(n_ports=2, name='Yf') self.Yr = wg.random(n_ports=2, name='Yr') self.If = wg.random(n_ports=1, name='If') self.Ir = wg.random(n_ports=1, name='Ir') ideals = [ wg.short(nports=2, name='short'), wg.open(nports=2, name='open'), wg.match(nports=2, name='load'), None, ] actuals = [ wg.short(nports=2, name='short'), wg.open(nports=2, name='open'), wg.match(nports=2, name='load'), wg.thru(), ] measured = [self.measure(k) for k in actuals] self.cal = SOLT(ideals=ideals, measured=measured, n_thrus=1, isolation=measured[2])
# a list of Network types, holding 'measured' responses short_measure = rf.Network(D_short_m) open_measure = rf.Network(D_open_m) load_measure = rf.Network(D_load_m) thru_measure = rf.Network(D_thru_m) my_measured = [ rf.two_port_reflect(open_measure, open_measure), rf.two_port_reflect(short_measure, load_measure), rf.two_port_reflect(load_measure, short_measure), thru_measure, ] ## create a SOLT instance cal = SOLT( ideals = my_ideals, measured = my_measured, ) # run calibration algorithm cal.run() # apply it to a dut dut = rf.Network(D_DUT_Measure) dut_calc = cal.apply_cal(dut) #Ideal DUT characteristic for compare DUT_IDEAL = rf.Network(D_DUT_Ideal) #plot DATA PLOT_smith(dut_calc, sp =11, label='Calculated DUT', N_fig=1) PLOT_smith(DUT_IDEAL, sp =11, label='Ideal DUT', N_fig=1)