Converting switch terms of a vdatb-file to Touchstone

60 views
Skip to first unread message

Michael Wollensack METAS

unread,
Jan 17, 2024, 7:25:39 AMJan 17
to VNA Tools
I've measured all four S-parameters (S11, S21, S12 and S22) and the switch terms using VNA Tools. The raw S-parameters and the switch terms are stored in a vdatb-file.
Now I would like to convert only the switch terms to a touchstone file.

How can I do that?

Michael Wollensack METAS

unread,
Jan 17, 2024, 7:26:51 AMJan 17
to VNA Tools
Hi,

you can do that using the following script:

# Export switch terms from vdatb-file
# Michael Wollensack METAS - 17.01.2024

import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('Metas.UncLib.LinProp')
clr.AddReference('Metas.Vna.Data')
clr.AddReference('Metas.Vna.Tools')
from System.IO import File
from System.Threading import Thread
from System.Windows.Forms import MessageBox
from Metas.UncLib.LinProp import UncNumber
from Metas.Vna.Data import Convert, SParamData, VnaParameter
from Metas.Vna.Data.FileIO import Touchstone
from Metas.Vna.Tools import Script

s = Script(RootPath)

d = s.LoadVnaData(r'Measurements_01\CalStandards\Thru_01.vdatb')
i1 = d.FindParameterIndex(VnaParameter.FromString('a1/b1_p2'))
i2 = d.FindParameterIndex(VnaParameter.FromString('a2/b2_p1'))

d2 = SParamData[UncNumber](d.Frequency, d.Ports, d.PortZr)

for i0 in range(d2.NFreq):
    d2.Data[i0][0][0] = d.ParameterData[i1].Data[i0]
    d2.Data[i0][1][1] = d.ParameterData[i2].Data[i0]

fs = File.Create(s.RootPath + r'\SwitchTerms_01.s2p')
Touchstone.Save[UncNumber](fs, d2)


Regards
Michael

Reply all
Reply to author
Forward
0 new messages