How to view covariance using Python?

45 views
Skip to first unread message

Rob Feldman

unread,
Jul 8, 2021, 4:13:15 PM7/8/21
to VNA Tools
Howdy,

I am trying to view the covariance of a specific frequency point using Python.

import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('Metas.Vna.Data')
clr.AddReference('Metas.Vna.Tools')
from System.Threading import Thread
from System.Windows.Forms import MessageBox
from Metas.Vna.Tools import Script
from Metas.Vna.Data import SParamData

s = Script(RootPath)
d=s.LoadSParamData(filename)
print(d[3,0,0].Real().Value)
print(d[3,0,0].Imag().Value)

Thanks in advance,
Rob

Michael Wollensack METAS

unread,
Jul 16, 2021, 7:54:43 AM7/16/21
to VNA Tools
Hi,

use the following code:

import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('Metas.UncLib.Core')
clr.AddReference('Metas.UncLib.Linprop')
clr.AddReference('Metas.Vna.Tools')
from System.Threading import Thread
from System.Windows.Forms import MessageBox
from Metas.UncLib.LinProp import Unc
from Metas.Vna.Tools import Script

s = Script(RootPath)
d = s.LoadSParamData(r'SOLT_01_out\DUTs\01419_Att20dB(f-m)_52371_01\01419_Att20dB(f-m)_52371_01_01.sdatb')

# single S-parameter S11
cv = Unc.GetCovariance(d[d.NFreq-1,0,0])
print(cv[0][0])
print(cv[1][0])
print(cv[1][1])


Regards
Michael

Reply all
Reply to author
Forward
0 new messages