add really basic usage file for developing vna class outside of gui
This commit is contained in:
31
charon_vna/vna_dev.py
Normal file
31
charon_vna/vna_dev.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# %% imports
|
||||||
|
import numpy as np
|
||||||
|
from matplotlib import pyplot as plt
|
||||||
|
|
||||||
|
from charon_vna.vna import Charon
|
||||||
|
|
||||||
|
# %%
|
||||||
|
frequency = np.linspace(80e6, 280e6, 31)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
vna = Charon(frequency=frequency)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
vna.set_switches(b=0, a=0)
|
||||||
|
s11 = vna.vna_capture(frequency)
|
||||||
|
vna.set_switches(b=1, a=0)
|
||||||
|
s21 = vna.vna_capture(frequency)
|
||||||
|
vna.set_switches(b=1, a=1)
|
||||||
|
s22 = vna.vna_capture(frequency)
|
||||||
|
vna.set_switches(b=0, a=1)
|
||||||
|
s12 = vna.vna_capture(frequency)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
plt.plot(s11.frequency, 20 * np.log10(np.abs(s11)), label="$S_{11}$")
|
||||||
|
plt.plot(s21.frequency, 20 * np.log10(np.abs(s21)), label="$S_{21}$")
|
||||||
|
plt.plot(s22.frequency, 20 * np.log10(np.abs(s22)), label="$S_{22}$")
|
||||||
|
plt.plot(s12.frequency, 20 * np.log10(np.abs(s12)), label="$S_{12}$")
|
||||||
|
plt.grid(True)
|
||||||
|
plt.legend()
|
||||||
|
|
||||||
|
# %%
|
Reference in New Issue
Block a user