Hello
I am trying to convert my S Parameter Data to the VDF using the Script function.
(VDF = |1+S11|/|S21|)
By searching this forum and using the help I was able to plot the VDF with it's uncertainty. However, I would like to save the VDF data somehow but I don't know how I am able to do this.
What I got so far:
# VDF - WiP - 25.07.2022
import math
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('Metas.UncLib.Core')
clr.AddReference('Metas.UncLib.LinProp')
clr.AddReference('Metas.Vna.Data')
clr.AddReference('Metas.Vna.Tools')
from System import Array
from System import Double
from System.Threading import Thread
from System.Windows.Forms import DockStyle
from System.Windows.Forms import MessageBox
from System.Windows.Forms import Form
from Metas.UncLib.Core import Complex
from Metas.UncLib.Core import Math as UMath
from Metas.UncLib.LinProp import UncNumber
from Metas.Vna.Data.Gui import GuiXYPlot
from Metas.Vna.Tools import Script
s = Script(RootPath)
d = s.LoadSParamData('Test.sdatb')
nfreq = d.NFreq
t1 = Complex[UncNumber](UncNumber(1.0))
VDF = [UMath.Abs[UncNumber]((t1+d[i, 0, 0])/(d[i, 1, 0])) for i in range(0, nfreq)]
VDF_Value = Array[Double]([VDF[i].Value for i in range(0, nfreq)])
VDF_unc = Array[Double]([2.0*VDF[i].StdUnc for i in range(0, nfreq)])
plot = GuiXYPlot()
plot.PlotXY(d.Frequency, VDF_Value, VDF_unc)
plot.XLabel = 'Frequency (Hz)'
plot.YLabel = 'VDF (dB)'
plot.Dock = DockStyle.Fill
form = Form()
form.Controls.Add(plot)
form.ShowDialog()
How am I able to export the data?