示例#1
0
 def test_accuracy(self):
     wg= rf.wr10
     wg.frequency = rf.F.from_f([1])
     
      
     X = wg.match(nports =2, name = 'X')
     Y = wg.match(nports =2, name='Y')
     X.s = rf.rand_c(len(wg.frequency),2,2)
     Y.s = rf.rand_c(len(wg.frequency),2,2)
     
     
     ideals = [
         wg.short(nports=2, name='short'),
         wg.open(nports=2, name='open'),
         wg.match(nports=2, name='load'),
         wg.thru(name='thru'),
         ]
     
     measured = [X**k**Y for k in ideals]
     
     cal = rf.Calibration(
         ideals = ideals,
         measured = measured,
         )
     for k in range(cal.nstandards):
         self.assertTrue(cal.apply_cal(measured[k]) == ideals[k]) 
示例#2
0
 def setUp(self):
     self.test_dir = os.path.dirname(os.path.abspath(__file__)) + '/'
     self.freq = rf.Frequency(1, 10, 101, 'ghz')
     self.s_2port = rf.rand_c(len(self.freq), 2, 2)
     self.s_1port = rf.rand_c(len(self.freq), 1, 1)
     self.n = n2.Network(frequency=self.freq, s=self.s_2port, z0=50)
 def setUp(self):
     self.test_dir = os.path.dirname(os.path.abspath(__file__))+'/'
     self.freq = rf.Frequency(1,10,101,'ghz')
     self.s_2port = rf.rand_c(len(self.freq),2,2)
     self.s_1port = rf.rand_c(len(self.freq),1,1)
     self.n = n2.Network(frequency=self.freq, s=self.s_2port, z0=50)