# measurement script
f_list = np.linspace(4000000000.0,4400000000.0,101)
pna = qt.instruments.create('pna','PNA_N5221A_sal',address = 'TCPIP::192.168.1.42::INSTR')
var_att = qt.instruments.create('var_att','agilent_var_attenuator',address = 'TCPIP::192.168.1.113::INSTR')
pna.reset()
pna.setup(start_frequency = 4000000000.0,measurement_format = 'MLOG',stop_frequency = 4400000000.0)
pna.set_resolution_bandwidth(100)
pna.set_sweeppoints(101)
pna.set_averages_on()
pna.set_averages(1)
pna.set_power(10)
var_att.set_var_att(70)
curr_source_adwin = qt.instruments.create('curr_source_adwin','ADwin_DAC_sal')
curr_source_adwin.start_process()
qt.mstart()
data = qt.Data(name='data')
data.create_file(datadirs=r'D:\steelelab-nas\measurement_data\BlueFors\door_computer\Sal\Kurma6A_C\2015_12_18_______15.8.6_____SingleTone__quick_scan')
spyview_process_3D(reset = True)
data.add_coordinate('Frequency [Hz]')
data.add_coordinate('Current [V_adwin]')
data.add_coordinate('None')
data.add_value('Transmission')
data.add_value('f_data [dBm]')
data.add_value('Phase')
curr_source_adwin.ramp_DAC_1(-5.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-5.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = True)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-4.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-4.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-4.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-4.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-4.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-4.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-4.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-4.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-3.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-3.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-3.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-3.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-3.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-3.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-3.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-3.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-2.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-2.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-2.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-2.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-2.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-2.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-2.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-2.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-1.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-1.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-1.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-1.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-1.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-1.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-1.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-1.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-0.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-0.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-0.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-0.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(-0.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(-0.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(0.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(0.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(0.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(0.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(0.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(0.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(0.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(0.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(1.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(1.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(1.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(1.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(1.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(1.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(1.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(1.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(2.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(2.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(2.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(2.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(2.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(2.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(2.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(2.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(3.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(3.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(3.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(3.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(3.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(3.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(3.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(3.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(4.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(4.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(4.25)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(4.25*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(4.5)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(4.5*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(4.75)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(4.75*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
curr_source_adwin.ramp_DAC_1(5.0)
pna.reset_averaging()
pna.sweep()
pna.auto_scale()
trace = pna.fetch_data(polar=True)
tr2 = pna.data_f()
data.add_data_point(f_list, list(5.0*ones(len(f_list))), list(0.0*ones(len(f_list))), trace[0], tr2, np.unwrap(trace[1]))
data.new_block()
spyview_process_3D(data,4000000000.0,4400000000.0,5,-5,0.0,newoutermostblockval = False)
qt.msleep(0.01)
data.close_file()
qt.mend()
pna.set_power(-10)
var_att.set_var_att(70)
var_att.remove()
curr_source_adwin.remove()
pna.remove()