diff --git a/Measure_S11.py b/Measure_S11.py index f582e73..d1fb30f 100644 --- a/Measure_S11.py +++ b/Measure_S11.py @@ -68,7 +68,8 @@ def measure_s_parameter(measurement, output_power,serial_num, start_freq, stop_f plt.ylabel("dBm") plt.title(f"{measurement}_{serial_num}") print(f"DONE measuring {measurement}") - plt.savefig(f"C:\\Users\\RadioLab\\Enigma_Testing_2022\\Antenna_Test_Files\\Results\\S11_Plots\\{measurement}_{serial_num}.png") + #plt.savefig(f"C:\\Users\\RadioLab\\Enigma_Testing_2022\\Antenna_Test_Files\\Results\\S11_Plots\\{measurement}_{serial_num}.png") + plt.savefig(f"Results/S11_Plots/{measurement}_{serial_num}.png") VNA.write(':CALCulate:SELected:FORMat REAL') time.sleep(1) data_real = VNA.query('CALCulate:DATA:FDaTa?') @@ -87,7 +88,8 @@ def measure_s_parameter(measurement, output_power,serial_num, start_freq, stop_f if con == 'y': ############################################################################## # load visa library - rm=visa.ResourceManager('C:\\Windows\\System32\\visa64.dll') # windows + #rm=visa.ResourceManager('C:\\Windows\\System32\\visa64.dll') # windows + rm=visa.ResourceManager('/opt/keysight/iolibs/libktvisa32.so') #linux # TODO linux # https://edadocs.software.keysight.com/kkbopen/linux-io-libraries-faq-589309025.html # https://www.keysight.com/us/en/lib/software-detail/computer-software/io-libraries-suite-downloads-2175637.html click linux @@ -166,12 +168,12 @@ def measure_s_parameter(measurement, output_power,serial_num, start_freq, stop_f f = np.linspace(start_freq,stop_freq,S11_raw.shape[-1]) nw2 = rf.Network(name=f"{serial_num_1}",s=S11_raw,frequency=f, z0=50) print(nw2) - nw2.write_touchstone(filename = f"{serial_num_1}",dir= 'C:\\Users\\RadioLab\\Enigma_Testing_2022\\Antenna_Test_Files\\Results\\Touchstone_Files') + nw2.write_touchstone(filename = f"{serial_num_1}",dir= 'Results/Touchstone_Files') #plot a smith chart of s11 nw2.plot_s_smith() plt.title(f"{serial_num_1} Smith Chart") - plt.savefig(f"C:\\Users\\RadioLab\\Enigma_Testing_2022\\Antenna_Test_Files\\Results\\Smith_Charts\\{serial_num_1}.jpg") + plt.savefig(f"Results/Smith_Charts/{serial_num_1}.jpg") print("Please Connect VNA to P2!") z= input("Please Connect VNA to P2!Press enter when Finished: ") @@ -183,12 +185,12 @@ def measure_s_parameter(measurement, output_power,serial_num, start_freq, stop_f f = np.linspace(start_freq,stop_freq,S11_raw.shape[-1]) nw2 = rf.Network(name=f"{serial_num_2}",s=S11_raw,frequency=f, z0=50) print(nw2) - nw2.write_touchstone(filename = f"{serial_num_2}",dir= 'C:\\Users\\RadioLab\\Enigma_Testing_2022\\Antenna_Test_Files\\Results\\Touchstone_Files') + nw2.write_touchstone(filename = f"{serial_num_2}",dir= 'Results/Touchstone_Files') #plot a smith chart of s11 nw2.plot_s_smith() plt.title(f"{serial_num_2} Smith Chart") - plt.savefig(f"C:\\Users\\RadioLab\\Enigma_Testing_2022\\Antenna_Test_Files\\Results\\Smith_Charts\\{serial_num_2}.jpg") + plt.savefig(f"Results/Smith_Charts/{serial_num_2}.jpg")