# power on
inst.write("OUTP ON")

# initalize channel, voltage, current
inst.write("APPL P6V, 0.0, 0.1")

count = 0


for v_indx in voltage_values:    
    inst.write("VOLT {}".format(v_indx))     # change voltage

    vna.sweep
    # S11
    s11 = vna.get_measurement(mname = meas_S11)
    # print(f'{meas_S11} measured')
    filename = meas_folder / ('THRU_' + meas_S11 + '.ntwk')
    # rf.write(str(filename), measurement)
    # measurement.frequency.units = 'ghz'
    # measurement.plot_s_db(ax = ax1, label ='THRU S11')
    
    #S22
    s22 = vna.get_measurement(mname = meas_S22)
    # print(f'{meas_S22} measured')
    filename = meas_folder / ('THRU_' + meas_S22 + '.ntwk')
    # rf.write(str(filename), measurement)
    # measurement.frequency.units = 'ghz'
    # measurement.plot_s_db(ax = ax2, label ='THRU S22')
    
    #S21
vna.create_meas(meas_S22,'S22', channel = meas_channel) 
meas_S21 = 'S21'
vna.create_meas(meas_S21,'S21', channel = meas_channel) 
meas_S12 = 'S12'
vna.create_meas(meas_S12,'S12', channel = meas_channel) 

vna.set_frequency_sweep(f_start, 
                        f_stop, 
                        f_npoints, 
                        f_unit = 'Hz',
                        channel = meas_channel, 
                        )
#%% SHORT S11 measurement 

vna.sweep
measurement = vna.get_measurement(mname = meas_S11)
print(f'{meas_S11} measured')

filename = meas_folder / ('SHORT_' + meas_S11 + '.ntwk')
rf.write(str(filename), measurement)
measurement.frequency.units = 'ghz'
measurement.plot_s_mag(ax = ax1, label ='Short S11')

#%%OPEN S11 measurement 

vna.sweep
measurement = vna.get_measurement(mname = meas_S11)
print(f'{meas_S11} measured')

filename = meas_folder / ('OPEN_' + meas_S11 + '.ntwk')
rf.write(str(filename), measurement)
예제 #3
0
vna.create_meas(meas_S21,'S21', channel = meas_channel) 
meas_S12 = 'S12'
vna.create_meas(meas_S12,'S12', channel = meas_channel) 

vna.set_frequency_sweep(f_start, 
                        f_stop, 
                        f_npoints, 
                        f_unit = 'Hz',
                        channel = meas_channel, 
                        )


#%%
vna.sweep

measurement_S11 = vna.get_measurement(mname = meas_S11)
measurement_S22 = vna.get_measurement(mname = meas_S22)
measurement_S21 = vna.get_measurement(mname = meas_S21)
measurement_S12 = vna.get_measurement(mname = meas_S12)


measurement = rf.two_port_reflect(measurement_S11, measurement_S22)
measurement.s[:,0,1] = measurement_S12.s[:,0,0]
measurement.s[:,1,0] = measurement_S21.s[:,0,0]

#%%
measurement_corrected = cal.apply_cal(measurement)

#%% plot
# %matplotlib qt5