else: S_amp = np.array(np.vstack((S_amp,amp_data))) S_phase = np.array(np.vstack((S_phase,adjusted_phase))) plt.rcParams["figure.figsize"] = [16,9] if (count-1)//monitor_ratio == (count-1)/monitor_ratio: plt.subplot(4, 1, 1) plt.plot(data['Frequency (Hz)'],amp_data) plt.ylabel('S11dB (dB)') plt.text(10, .25,['Power: ', ZND.GetPower() , 'dB'], fontdict=font) plt.xlim(1e9*start_freq,1e9*stop_freq) plt.subplot(4, 1, 2) plt.plot(data['Frequency (Hz)'],adjusted_phase) plt.ylabel('Phase (°)') plt.xlim(1e9*start_freq,1e9*stop_freq) plt.subplot(4, 1, 3) plt.contourf(data['Frequency (Hz)'],power_pattern[0:count+1],S_amp) plt.ylabel('power (dB)') plt.title('S11dB (dB)')
plt.ylabel('$V_g$ (V)') plt.title('S11dB (dB)') plt.xlabel('Frequency (GHz)') # plt.subplot(4, 1, 4) # plt.contourf(data['Frequency (Hz)']*1e-9,pattern['ramp_pattern'][0:count+1],S_phase*180/np.pi) # plt.ylabel('$V_g$ (V)') # plt.title('Phase (°)', backgroundcolor = 'white') plt.pause(0.1) if save_data: # temp = tempdev.GetTemperature() data['Power (dBm)'] = VNA.GetPower() data['Gate Voltage (V)'] = gate_voltage data['Leakage Current (A)'] = leakage_current data['Temperature (K)'] = temp if count == 0: colnames = [ 'Vset (V)', 'Imeas (A)', 'R (Ohm)', 'Vgate (V)', 'T (K)', 'Ileakage (nA)' ] Data = stlab.newfile(prefix, '_', colnames, autoindex=True, mypath=path)
plt.subplot(2, 1, 2) plt.contourf(data['Frequency (Hz)'],gate,S21dB) plt.ylabel('gate voltage (V)') plt.title('S21dB (dB)') plt.xlabel('Frequency (Hz)') print ("plotting finished") plt.pause(0.1) if save_data: # temp = tempdev.GetTemperature() data['Power (dBm)'] = ZND.GetPower() data['Gate Voltage (V)'] = gate_voltage data['Leakage Current (A)'] = leakage_current data['Temperature (K)'] = temp if count==0: Data = stlab.newfile(prefix,'_',data.keys(),autoindex = True) stlab.savedict(Data, data) Temp = np.append(Temp,temp) # stlab.metagen.fromarrays(Data,data['Frequency (Hz)'],powers[0:i+1],xtitle='Frequency (Hz)', ytitle='Power (dB)',colnames=data.keys()) # stlab.writeline(Data,data) # stlab.writeline(Gate_Data,[gate_voltage, leakage_current])