Skip to content
Snippets Groups Projects
Commit 18f32745 authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

To be released

parent 197324e6
Branches
No related tags found
No related merge requests found
......@@ -3,10 +3,12 @@ sys.path.insert(0, './lib')
sys.path.insert(0, '..') #append parent directory
import hp4155a
from interface import *
from help import *
import transfer
import output
import gatediode
import configparser
......@@ -47,7 +49,7 @@ def on_start_clicked(b):
else: # Sequential measurement
transfer.SEQ(ui,device)
if output_check.value == True:
if ui.output_check.value == True:
if ui.output_gates.value == "VTG":
output.VTG(ui,device)
elif ui.output_gates.value == "VBG":
......@@ -56,7 +58,7 @@ def on_start_clicked(b):
output.SEQ(ui,device)
if gatediode_check.value == True:
if ui.gatediode_check.value == True:
if ui.gatediode_gates.value == 'VTG':
gatediode.VTG(ui,device)
else: #VBG
......@@ -66,7 +68,7 @@ def on_start_clicked(b):
change_state(ui.all_widgets)
def on_export_ini_clicked(b):
with output:
with ui.output:
change_state(ui.all_widgets)
config = configparser.ConfigParser()
default_filename = 'ADU_double_gate.ini'
......@@ -165,7 +167,7 @@ def on_export_ini_clicked(b):
def on_import_ini_clicked(b):
with output:
with ui.output:
change_state(ui.all_widgets)
#load values to the interface
config = configparser.ConfigParser()
......@@ -246,9 +248,9 @@ def on_import_ini_clicked(b):
change_state(ui.all_widgets)
button.on_click(on_start_clicked)
import_ini_button.on_click(on_import_ini_clicked)
export_ini_button.on_click(on_export_ini_clicked)
ui.start.on_click(on_start_clicked)
ui.import_ini.on_click(on_import_ini_clicked)
ui.export_ini.on_click(on_export_ini_clicked)
......
%% Cell type:code id:51b012d0-95b0-41c2-81bb-2205f3c53be2 tags:
``` python
%run double_gate_ADU.py
```
%% Output
%% Cell type:code id:96ff60d6-a9c5-4f9c-b28e-ea6003e6e8a8 tags:
%% Cell type:code id:3d0c5404-a1c6-40f9-bffd-625199c945a7 tags:
``` python
```
......
......@@ -51,6 +51,8 @@ def VTG(ui,device):
plotted_variables = graph_tool(ui.plot_gatediode,ui.sample.width.value,device)
device.error_occured()
device.single_measurement()
while device.operation_completed()==False:
pass
......@@ -119,7 +121,7 @@ def VBG(ui,device):
)
try:
device.setup_smu(ui.sample.top_gate.value,smu_top_gate)
device.setup_smu(ui.sample.top_gate.value,smu_back_gate)
device.setup_smu(ui.sample.source.value,smu_source)
# disable back gate smu
......@@ -131,11 +133,13 @@ def VBG(ui,device):
device.setup_var1(var1)
device.integration_time(ui.integration_gatediode.value)
variables_list = ['VBG','VTG']
variables_list = ['VBG','IBG']
device.variables_to_save(variables_list)
plotted_variables = graph_tool(ui.plot_gatediode,ui.sample.width.value,device)
device.error_occured()
device.single_measurement()
while device.operation_completed()==False:
pass
......
......@@ -7,6 +7,7 @@ import tkinter as tk
from tkinter import filedialog
import tkinter.messagebox
import copy
import os
import pandas as pd
......@@ -167,12 +168,12 @@ def graph_tool(plot_config,width,device): # the plot config object from the inte
device.display_variable('Y1',"A"+plot_config.y1.value)
else:
device.display_variable('Y1',plot_config.y1.value)
device.axis_scale('Y1',plot_config.y1.value)
device.axis_scale('Y1',plot_config.y1_scale.value)
device.display_variable_min_max('Y1','MIN',plot_config.y1_min.value)
device.display_variable_min_max('Y1','MAX',plot_config.y1_max.value)
if plot_config.y2.value!= "None":
if params["PLOT"]["y2_scale"]=='LOG':
if plot_config.y2_scale.value=='LOG':
device.display_variable('Y2',"A"+plot_config.y2.value)
else:
device.display_variable('Y2',plot_config.y2.value)
......@@ -214,6 +215,8 @@ def create_file(filename):
root.destroy()
return file
def write_sample_information(sample,file):
file.write(f"Series:{sample.processing_number.value}"+"\n")
file.write(f"Sample:{sample.sample.value}"+"\n")
......@@ -225,7 +228,7 @@ def create_plot(plot_config,df,file,fig_title,legend_title,save):
labels = df["label"].unique()
colors = plt.cm.tab20.colors[:len(labels)]
fig1,ax1 = plt.subplots(figsize = (10,6))
fig,ax1 = plt.subplots(figsize = (10,6))
x_col,x_label = column_to_plot(plot_config.x.value)
y1_col, y1_label = column_to_plot(plot_config.y1.value)
......@@ -233,7 +236,7 @@ def create_plot(plot_config,df,file,fig_title,legend_title,save):
ax1.set_yscale('log')
for color, label in zip(colors,labels):
subset = df[df["label"]== label]
ax1.plot(subset[x_col],subset[y_col].abs(),color = color,label = label)
ax1.plot(subset[x_col],subset[y1_col].abs(),color = color,label = label)
else:
for color, label in zip(colors,labels):
subset = df[df["label"]== label]
......@@ -259,10 +262,10 @@ def create_plot(plot_config,df,file,fig_title,legend_title,save):
# now for the y2 axis
if plot_config.y2.value!= "None":
fig,ax2 = plt.subplots(figsize = (10,6))
y2_col, y2_label = column_to_plot(plot_config.y2_value)
y2_col, y2_label = column_to_plot(plot_config.y2.value)
if plot_config.y2_scale.value == 'LOG':
ax1.set_yscale('log')
ax2.set_yscale('log')
for color, label in zip(colors,labels):
subset = df[df["label"]== label]
ax2.plot(subset[x_col],subset[y2_col].abs(),color = color,label = label)
......@@ -272,7 +275,7 @@ def create_plot(plot_config,df,file,fig_title,legend_title,save):
ax2.plot(subset[x_col],subset[y2_col],color = color,label = label)
ax2.set_xlabel(x_label)
ax2.set_ylabel(y1_label)
ax2.set_ylabel(y2_label)
ax2.set_title(fig_title,fontweight = 'bold')
ax2.grid(True)
ax2.legend(
......
......@@ -28,7 +28,7 @@ def VTG(ui,device):
smu_back_gate.update(vname = 'VBG',iname='IBG',mode = 'COMM',func = 'CONS')
smu_drain = device.smu_dict()
smu_drain = device.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR1')
smu_drain.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR1')
# setup VAR1
var1 = device.var1_dict()
......@@ -63,7 +63,9 @@ def VTG(ui,device):
variables_list = ['VDS','ID','VTG','ITG']
device.variables_to_save(variables_list)
plotted_variables = graph_tool(plot_output,ui.sample.width.value,device)
plotted_variables = graph_tool(ui.plot_output,ui.sample.width.value,device)
device.error_occured()
device.single_measurement()
......@@ -113,7 +115,7 @@ def VTG(ui,device):
df.to_csv(file,sep=" ",mode='a')
if ui.sample.quick.value == False:
df["label"] = df.apply(lambda row:f"VTG = {row["VTG/V"]} (V)",axis = 1) # assign labels
df["label"] = df.apply(lambda row:f"VTG = {row['VTG/V']} (V)",axis = 1) # assign labels
create_plot(ui.plot_output,df,file,"Top Gate Output Measurement", "Swept VTG voltages:",ui.sample.save_fig.value)
......@@ -136,7 +138,7 @@ def VBG(ui,device):
smu_back_gate.update(vname = 'VBG',iname='IBG',mode = 'V',func = 'VAR2')
smu_drain = device.smu_dict()
smu_drain = device.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR1')
smu_drain.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR1')
# setup VAR1
var1 = device.var1_dict()
......@@ -174,6 +176,8 @@ def VBG(ui,device):
plotted_variables = graph_tool(ui.plot_output,ui.sample.width.value,device)
device.error_occured()
device.single_measurement()
while device.operation_completed()==False:
......@@ -224,16 +228,18 @@ def VBG(ui,device):
df.to_csv(file,sep=" ",mode='a')
if ui.sample.quick.value == False:
df["label"] = df.apply(lambda row:f"VBG = {row["VBG/V"]} (V)",axis = 1) # assign labels
create_plot(ui,df,file,"Back Gate Output Measurement", "Swept VBG voltages:",ui.sample.save_fig.value)
df["label"] = df.apply(lambda row:f"VBG = {row['VBG/V']} (V)",axis = 1) # assign labels
create_plot(ui.plot_output,df,file,"Back Gate Output Measurement", "Swept VBG voltages:",ui.sample.save_fig.value)
def SEQ(ui,device):
device.del_user_functions() # delete all user functions
device.clear_error_stack() # clear error stack
norm = normalization_factor(ui.sample.width.value)
points_VTG = number_of_points(ui.Vtg_output)
points_VBG = number_of_points(ui.Vbg_output)
try:
values_VBG = np.linspace(ui.Vbg_output.start.value, ui.Vbg_output.stop.value,num = points,endpoint = True)
values_VBG = np.linspace(ui.Vbg_output.start.value, ui.Vbg_output.stop.value,num = points_VBG,endpoint = True)
except:
error_box("Invalid VBG values!")
return
......@@ -248,7 +254,7 @@ def SEQ(ui,device):
smu_back_gate.update(vname = 'VBG',iname='IBG',mode = 'V',func = 'CONS')
smu_drain = device.smu_dict()
smu_drain = device.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR1')
smu_drain.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR1')
# setup VAR1
var1 = device.var1_dict()
......@@ -285,7 +291,9 @@ def SEQ(ui,device):
device.variables_to_save(variables_list)
plotted_variables = graph_tool(ui.plot_output,ui.sample.width.value,device)
for i,value in enumerate(VBG_values):
device.error_occured()
for i,value in enumerate(values_VBG):
cons = device.cons_smu_dict()
cons.update(comp = ui.Vbg_output.comp.value, value = value)
device.setup_cons_smu(ui.sample.back_gate.value,cons)
......@@ -326,7 +334,7 @@ def SEQ(ui,device):
f.write("Sweeping Gate:VTG,VBG sequentially"+"\n\n")
f.write('Parameters\n')
f.write(f"VBG from {ui.Vbg_output.start.value}V to {ui.Vbg_output.stop.value}V with step {ui.Vbg_output.step.value}V"+"\n")
f.write(f"VTG from {ui.Vtg_output.start.value]}V to {ui.Vtg_output.stop.value}V with step {ui.Vbg_output.step.value}V"+"\n")
f.write(f"VTG from {ui.Vtg_output.start.value}V to {ui.Vtg_output.stop.value}V with step {ui.Vbg_output.step.value}V"+"\n")
f.write(f"VDS from {ui.Vds_output.start.value}V to {ui.Vds_output.stop.value}V with step {ui.Vds_output.step.value}V"+"\n")
f.write(f"Back Gate Current Compliance/A:{ui.Vbg_output.comp.value}"+"\n")
......@@ -346,7 +354,7 @@ def SEQ(ui,device):
df.to_csv(file,sep=" ",mode='a')
if ui.sample.quick.value == False:
df["label"] = df.apply(lambda row:f"VTG = {row["VTG/V"]} (V), VBG = {row["VBG/V"]} (V)",axis = 1) # assign labels
df["label"] = df.apply(lambda row:f"VTG = {row['VTG/V']} (V), VBG = {row['VBG/V']} (V)",axis = 1) # assign labels
create_plot(ui.plot_output,df,file,"Sequential Sweep of Both Gates Output Measurement", "Swept voltages:",ui.sample.save_fig.value)
......
......@@ -27,7 +27,7 @@ def VTG(ui,device):
smu_back_gate.update(vname = 'VBG',iname='IBG',mode = 'COMM',func = 'CONS')
smu_drain = device.smu_dict()
smu_drain = device.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
smu_drain.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
# setup VAR1
var1 = device.var1_dict()
......@@ -65,6 +65,8 @@ def VTG(ui,device):
plotted_variables = graph_tool(ui.plot_transfer,ui.sample.width.value,device)
device.error_occured()
device.single_measurement()
while device.operation_completed()==False:
pass
......@@ -113,7 +115,7 @@ def VTG(ui,device):
df.to_csv(file,sep=" ",mode='a')
if ui.sample.quick.value == False:
df["label"] = df.apply(lambda row:f"VDS = {row["VDS/V"]} (V)",axis = 1) # assign labels
df["label"] = df.apply(lambda row:f"VDS = {row['VDS/V']} (V)",axis = 1) # assign labels
create_plot(ui.plot_transfer,df,file,"Top Gate Transfer Measurement", "Swept VDS voltages:",ui.sample.save_fig.value)
def VBG(ui,device):
......@@ -134,7 +136,7 @@ def VBG(ui,device):
smu_back_gate.update(vname = 'VBG',iname='IBG',mode = 'V',func = 'VAR1')
smu_drain = device.smu_dict()
smu_drain = device.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
smu_drain.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
var1 = device.var1_dict()
......@@ -172,6 +174,8 @@ def VBG(ui,device):
plotted_variables = graph_tool(ui.plot_transfer,ui.sample.width.value,device)
device.error_occured()
device.single_measurement()
while device.operation_completed()==False:
......@@ -222,12 +226,12 @@ def VBG(ui,device):
df.to_csv(file,sep=" ",mode='a')
if ui.sample.quick.value == False:
df["label"] = df.apply(lambda row:f"VDS = {row["VDS/V"]} (V)",axis = 1) # assign labels
df["label"] = df.apply(lambda row:f"VDS = {row['VDS/V']} (V)",axis = 1) # assign labels
create_plot(ui.plot_transfer,df,file,"Back Gate Transfer Measurement", "Swept VDS voltages:",ui.sample.save_fig.value)
# Simultaneously bóth gates
def SIM():
def SIM(ui,device):
device.del_user_functions() # delete all user functions
device.clear_error_stack() # clear error stack
# setup the smus
......@@ -245,7 +249,7 @@ def SIM():
smu_back_gate.update(vname = 'VBG',iname='IBG',mode = 'V',func = 'VARD')
smu_drain = device.smu_dict()
smu_drain = device.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
smu_drain.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
var1 = device.var1_dict()
......@@ -271,7 +275,7 @@ def SIM():
ratio,offset = calculate_line(ui.Vtg_transfer,ui.Vbg_transfer)
# update VBG step
ui.Vbg_transfer.step.value = Decimal(str(ratio)) * Decimal(str(Vtg_transfer.step.value))
ui.Vbg_transfer.step.value = Decimal(str(ratio)) * Decimal(str(ui.Vtg_transfer.step.value))
vard = device.vard_dict()
vard.update(
......@@ -298,6 +302,8 @@ def SIM():
plotted_variables = graph_tool(ui.plot_transfer,ui.sample.width.value,device)
device.error_occured()
device.single_measurement()
while device.operation_completed()==False:
......@@ -332,7 +338,7 @@ def SIM():
f.write("Sweeping Gate:VTG,VBG simultaneously"+"\n\n")
f.write('Parameters\n')
f.write(f"VBG from {ui.Vbg_transfer.start.value}V to {ui.Vbg_transfer.stop.value}V with step {ui.Vbg_transfer.step.value}V"+"\n")
f.write(f"VTG from {ui.Vtg_transfer.start.value]}V to {ui.Vtg_transfer.stop.value}V with step {ui.Vbg_transfer.step.value}V"+"\n")
f.write(f"VTG from {ui.Vtg_transfer.start.value}V to {ui.Vtg_transfer.stop.value}V with step {ui.Vbg_transfer.step.value}V"+"\n")
f.write(f"VDS from {ui.Vds_transfer.start.value}V to {ui.Vds_transfer.stop.value}V with step {ui.Vds_transfer.step.value}V"+"\n")
if ui.Vbg_transfer.pcomp.value==0:
......@@ -355,17 +361,19 @@ def SIM():
df.to_csv(file,sep=" ",mode='a')
if ui.sample.quick.value == False:
df["label"] = df.apply(lambda row:f"VDS = {row["VDS/V"]} (V)",axis = 1) # assign labels
df["label"] = df.apply(lambda row:f"VDS = {row['VDS/V']} (V)",axis = 1) # assign labels
create_plot(ui.plot_transfer,df,file,"Simultaneous Sweep of Both Gates Transfer Measurement", "Swept VDS voltages:",ui.sample.save_fig.value)
def SEQ(ui,device):
device.del_user_functions() # delete all user functions
device.clear_error_stack() # clear error stack
norm = normalization_factor(ui.sample.width.value)
points_VDS = number_of_points(ui.Vds_transfer)
points_VBG = number_of_points(ui.Vbg_transfer)
try:
values_VBG = np.linspace(ui.Vbg_transfer.start.value,ui.Vbg_transfer.stop.value,num = points, endpoint = True)
values_VBG = np.linspace(ui.Vbg_transfer.start.value,ui.Vbg_transfer.stop.value,num = points_VBG, endpoint = True)
except:
error_box("Invalid VBG values!")
return
......@@ -380,7 +388,7 @@ def SEQ(ui,device):
smu_back_gate.update(vname = 'VBG',iname='IBG',mode = 'V',func = 'CONS') # Only VTG is swept
smu_drain = device.smu_dict()
smu_drain = device.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
smu_drain.update(vname='VDS',iname='ID',mode = 'V',func = 'VAR2')
# setup VAR1
......@@ -398,7 +406,7 @@ def SEQ(ui,device):
var2.update(
start=ui.Vds_transfer.start.value,
step=ui.Vds_transfer.step.value,
points=points,
points=points_VDS,
comp=ui.Vds_transfer.comp.value,
pcomp=ui.Vds_transfer.pcomp.value,
)
......@@ -419,8 +427,10 @@ def SEQ(ui,device):
plotted_variables = graph_tool(ui.plot_transfer,ui.sample.width.value,device)
device.error_occured()
# In the end VBG is swept
for i,value in enumerate(VBG_values):
for i,value in enumerate(values_VBG):
cons = device.cons_smu_dict()
cons.update(comp = ui.Vbg_transfer.comp.value, value = value)
device.setup_cons_smu(ui.sample.back_gate.value,cons)
......@@ -461,7 +471,7 @@ def SEQ(ui,device):
f.write("Sweeping Gate:VTG,VBG sequentially"+"\n\n")
f.write('Parameters\n')
f.write(f"VBG from {ui.Vbg_transfer.start.value}V to {ui.Vbg_transfer.stop.value}V with step {ui.Vbg_transfer.step.value}V"+"\n")
f.write(f"VTG from {ui.Vtg_transfer.start.value]}V to {ui.Vtg_transfer.stop.value}V with step {ui.Vbg_transfer.step.value}V"+"\n")
f.write(f"VTG from {ui.Vtg_transfer.start.value}V to {ui.Vtg_transfer.stop.value}V with step {ui.Vbg_transfer.step.value}V"+"\n")
f.write(f"VDS from {ui.Vds_transfer.start.value}V to {ui.Vds_transfer.stop.value}V with step {ui.Vds_transfer.step.value}V"+"\n")
f.write(f"Back Gate Current Compliance/A:{ui.Vbg_transfer.comp.value}"+"\n")
......@@ -482,9 +492,9 @@ def SEQ(ui,device):
if ui.sample.quick.value == False:
if ui.plot_transfer.x.value == 'VTG':
df["label"] = df.apply(lambda row:f"VDS = {row["VDS/V"]} (V), VBG = {row["VBG/V"]} (V)",axis = 1) # assign labels
df["label"] = df.apply(lambda row:f"VDS = {row['VDS/V']} (V), VBG = {row['VBG/V']} (V)",axis = 1) # assign labels
else:
df["label"] = df.apply(lambda row:f"VDS = {row["VDS/V"]} (V), VTG = {row["VTG/V"]} (V)",axis = 1) # assign labels
df["label"] = df.apply(lambda row:f"VDS = {row['VDS/V']} (V), VTG = {row['VTG/V']} (V)",axis = 1) # assign labels
create_plot(ui.plot_transfer,df,file,"Sequential Sweep of Both Gates Transfer Measurement", "Swept voltages:",ui.sample.save_fig.value)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment