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

sync plot tool-software completed and parameters added to ini files!

parent 4bb37960
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,6 @@ Vbg_output_widgets,Vbg_output = additional_secondary('VBG',-15,5,15,1e-3)
plot_output_widgets,plot_output = plot_config(2)
output_box = widgets.VBox([integration_output,output_gates,Vds_output_widgets,Vtg_output_widgets,Vbg_output_widgets,plot_output_widgets])
#GateDiodde
terminal = widgets.Dropdown(
options = ['VTG','VBG'],
......@@ -83,7 +81,6 @@ line = widgets.HBox([button,import_ini_button,export_ini_button])
display(line,output)
device = hp4155a.HP4155a('GPIB0::17::INSTR')
def on_start_clicked(b):
with output:
clear_output()
......@@ -95,7 +92,6 @@ def on_start_clicked(b):
check_configuration(smu_map)
except Exception as e:
error_box(e)
replot_button.disabled = True
enable_widgets(all_widgets)
return
......@@ -480,6 +476,10 @@ def on_export_ini_clicked(b):
for parameter,widget in Vds_transfer.items():
config.set('Vds_transfer',parameter,str(widget.value))
config.add_section('Plot_transfer')
for parameter,widget in plot_transfer.items():
config.set('Plot_transfer',parameter,str(widget.value))
#output
config.add_section('Output')
config.set('Output','Integration',integration_output.value)
......@@ -496,6 +496,10 @@ def on_export_ini_clicked(b):
for parameter,widget in Vds_output.items():
config.set('Vds_output',parameter,str(widget.value))
config.add_section('Plot_output')
for parameter,widget in plot_output.items():
config.set('Plot_output',parameter,str(widget.value))
# Gatediode
config.add_section('Gatediode')
config.set('Gatediode','Integration',integration_gatediode.value)
......@@ -504,6 +508,10 @@ def on_export_ini_clicked(b):
for parameter,widget in Vg_gatediode.items():
config.set('Vg_gatediode',parameter,str(widget.value))
config.add_section('Plot_gatediode')
for parameter,widget in plot_gatediode.items():
config.set('Plot_gatediode',parameter,str(widget.value))
config.write(configfile)
except Exception as e:
information_box(e)
......@@ -535,6 +543,8 @@ def on_import_ini_clicked(b):
widget.value = config.get('Vds_transfer',parameter)
for parameter,widget in Vbg_transfer.items():
widget.value = config.get('Vbg_transfer',parameter)
for parameter,widget in plot_transfer.items():
widget.value = config.get('Plot_transfer',parameter)
#output curve
integration_output.value = config.get('Output','integration')
......@@ -545,11 +555,17 @@ def on_import_ini_clicked(b):
for parameter,widget in Vbg_output.items():
widget.value = config.get('Vbg_output',parameter)
for parameter,widget in plot_output.items():
widget.value = config.get('Plot_output',parameter)
# gatediode
integration_gatediode.value = config.get('Gatediode','integration')
for parameter,widget in Vg_gatediode.items():
widget.value = config.get('Vg_gatediode',parameter)
for parameter,widget in plot_gatediode.items():
widget.value = config.get('Plot_gatediode',parameter)
information_box("all parameters loaded succesfully")
except Exception as error:
if type(error).__name__ =='NoSectionError':
......
......@@ -212,7 +212,6 @@ def check_error(device):
# The function for graph in the tool
def graph_tool(params):
device.delete_axis("X")
device.delete_axis("Y1")
device.delete_axis("Y2")
......@@ -271,60 +270,3 @@ def graph_tool(params):
check_error(device)
\ No newline at end of file
#Send the the graph from the tool in the software
def graph_software(params,meas):
#plotted variables as they are named in the tool
#return the plotted data for easier configuration
plotted_variables = {'X':device.get_axis_variable('X'),'Y1': device.get_axis_variable('Y1')}
if params["PLOT"]["y2"]!= None:
plotted_variables['Y2']= device.get_axis_variable('Y2')
plot_values ={}
for axis,variable in plotted_variables.items():
plot_values.setdefault(axis,device.return_values(variable))
plot_list = [params["PLOT"]["x"],params["PLOT"]["y1"],params["PLOT"]["y2"]]
scale_list = [params["PLOT"]["x_scale"],params["PLOT"]["y1_scale"],params["PLOT"]["y2_scale"]]
axes_labels = []
fig,ax1= plt.subplots(figsize=(10,6),layout='constrained')
if scale_list[0] == 'LOG':
ax1.set_xscale('log')
if scale_list[1]=='LOG':
ax1.set_yscale('log')
# define the axes labels similarly to the user functions
for element in plot_list:
if element != None: #only the last one
if element.startswith("V"):
label = f"{element} (V)"
elif element.startswith('I') and element.endswith('mm'):
label = f"{element[:-2]} (uA/(um))"
else: # regular I
label = f"{element} (A)"
axes_labels.append(label)
#now set the labels
ax1.set_xlabel(axes_labels[0])
ax1.set_ylabel(axes_labels[1])
#plot scatter
ax1.scatter(plot_values["X"],plot_values["Y1"],color ='y')
#add the second axis if applicable
if plot_list[2]! = None:
ax2 = ax1.twinx()
if scale_list[2]=='LOG':
ax1.set_yscale('log')
ax2.set_ylabel(axes_labels[2])
ax2.scatter(plot_values["X"],plot_values["Y2 "],color ='b')
\ 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