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

Ini files fix and Plotting configurations

parent 80132460
Branches
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ from help import * ...@@ -8,6 +8,8 @@ from help import *
from measurements import * from measurements import *
import configparser import configparser
plt.ioff()
# Create the grids # Create the grids
#create the information grid #create the information grid
style = {'description_width': 'initial'} style = {'description_width': 'initial'}
......
%% Cell type:code id:51b012d0-95b0-41c2-81bb-2205f3c53be2 tags: %% Cell type:code id:51b012d0-95b0-41c2-81bb-2205f3c53be2 tags:
``` python ``` python
%matplotlib widget
%run double_gate_ADU.py %run double_gate_ADU.py
``` ```
%% Output %% Output
%% Cell type:code id:329c0c76-4194-4805-ab3f-fe9f55f79eea tags: %% Cell type:code id:329c0c76-4194-4805-ab3f-fe9f55f79eea tags:
``` python ``` python
``` ```
......
...@@ -146,7 +146,10 @@ def save_as_ini(default_filename): ...@@ -146,7 +146,10 @@ def save_as_ini(default_filename):
#check if the file path is correct(.txt) #check if the file path is correct(.txt)
while file.endswith(".ini") == False: while file.endswith(".ini") == False:
#open again filedialog with error message box #open again filedialog with error message box
tk.messagebox.showerror(message='invalid filename!') answer=tk.messagebox.askyesno(message='Do you want to cancel the ini file Save?')
if answer == True:
raise Exception("Ini File Operation aborted!")
else:
file = filedialog.asksaveasfilename(defaultextension=".ini", filetypes=[("Ini files","*.ini")],title = "save as ini",initialfile =default_filename) file = filedialog.asksaveasfilename(defaultextension=".ini", filetypes=[("Ini files","*.ini")],title = "save as ini",initialfile =default_filename)
root.destroy() root.destroy()
return file return file
...@@ -162,7 +165,10 @@ def load_ini(): ...@@ -162,7 +165,10 @@ def load_ini():
file = filedialog.askopenfilename(filetypes=[("Ini files","*.ini")],title ='Select ini file') file = filedialog.askopenfilename(filetypes=[("Ini files","*.ini")],title ='Select ini file')
while file.endswith(".ini") == False: while file.endswith(".ini") == False:
#open again filedialog with error message box #open again filedialog with error message box
tk.messagebox.showerror(message='invalid filename!') answer=tk.messagebox.askyesno(message='Do you want to cancel the ini file load?')
if answer == True:
raise Exception("Ini File Operation aborted!")
else:
file = filedialog.askopenfilename(filetypes=[("Ini files","*.ini")],title = "Select ini file") file = filedialog.askopenfilename(filetypes=[("Ini files","*.ini")],title = "Select ini file")
root.destroy() root.destroy()
return file return file
...@@ -214,7 +220,7 @@ def replot_results(replot_dict,df,points,title): ...@@ -214,7 +220,7 @@ def replot_results(replot_dict,df,points,title):
ax.plot(x[i],y[i]) ax.plot(x[i],y[i])
fig.suptitle(title, fontweight ="bold") fig.suptitle(title, fontweight ="bold")
display(fig) fig.show() # Do this interactively to save the figures
except: except:
information_box("reploting failed please try again") information_box("reploting failed please try again")
......
...@@ -239,13 +239,12 @@ def additional_secondary(name,start,step,stop,comp): ...@@ -239,13 +239,12 @@ def additional_secondary(name,start,step,stop,comp):
} }
return secondary_grid,parameters return secondary_grid,parameters
def replot(): def replot(title):
replot_grid = GridspecLayout(7,2) replot_grid = GridspecLayout(7,2)
replot_grid[0,0]= widgets.Checkbox( replot_grid[0,0]= widgets.Label(
description = "Replot", title,
value = False, style = style,
indent = False,
) )
replot_grid[1,0] = widgets.Label('X-axis',layout=Layout(height='auto', width='auto')) replot_grid[1,0] = widgets.Label('X-axis',layout=Layout(height='auto', width='auto'))
...@@ -296,12 +295,66 @@ def replot(): ...@@ -296,12 +295,66 @@ def replot():
'y_max':replot_grid[4,1], 'y_max':replot_grid[4,1],
'y_scale':replot_grid[5,1], 'y_scale':replot_grid[5,1],
'y_auto':replot_grid[6,1], 'y_auto':replot_grid[6,1],
'check': replot_grid[0,0] 'button': replot_grid[0,0]
} }
return replot_grid, replot_dict return replot_grid, replot_dict
def plot_config(meas,x,y1,y2=None): #meas = 1,2,3 for transfer,output,gatediode
config_grid = GridspecLayout(6,4)
if meas ==3:
options = ['VTG','VBG','ITG','IBG','ITGmm','IBGmm',None]
else:
options = ['VTG','VBG','VDS','ITG','IBG','ID','ITGmm','IBGmm','IDmm',None]
config_grid[0,:]=widgets.Checkbox(description ='Send Manually Plotting configurations to the tool',layout=Layout(height='auto', width='auto'),indent = False,value = False)
#first line headers
config_grid[1,1]= widgets.Label('X',layout=Layout(height='auto', width='auto'))
config_grid[1,2]= widgets.Label('Y1',layout=Layout(height='auto', width='auto'))
config_grid[1,3]= widgets.Label('Y2',layout=Layout(height='auto', width='auto'))
#first column
config_grid[2,0] = widgets.Label('NAME',layout=Layout(height='auto', width='auto'))
config_grid[3,0] = widgets.Label('SCALE',layout=Layout(height='auto', width='auto'))
config_grid[4,0] = widgets.Label('MIN',layout=Layout(height='auto', width='auto'))
config_grid[5,0] = widgets.Label('MAX',layout=Layout(height='auto', width='auto'))
#iterate through the second line (NAME)
config_grid[2,1]=widgets.Dropdown(layout=Layout(height='auto', width='auto'),options = options,value = x)
config_grid[2,2]=widgets.Dropdown(layout=Layout(height='auto', width='auto'),options = options,value = y1)
config_grid[2,3]=widgets.Dropdown(layout=Layout(height='auto', width='auto'),options = options,value = y2)
#Iterate through the third line (scale)
options_scale = ['LIN','LOG']
for j in range(1,4):
config_grid[3,j] = widgets.Dropdown(value = 'LIN',options = options_scale, layout=Layout(height='auto', width='auto'))
#iterate throuh the last 2 lines(min-max)
for j in range(1,4):
config_grid[4,j] = widgets.FloatText(value = 0) #min
config_grid[5,1]=widgets.FloatText(value = 1) #max X-axis
config_grid[5,2]=widgets.FloatText(value = 0.1) #max Y1-axis
config_grid[5,3]=widgets.FloatText(value = 0) #max Y2-axis
config_dict = {
"x":config_grid[1,1],
"y1":config_grid[1,2],
"y2":config_grid[1,3],
"x_scale":config_grid[2,1],
"y1_scale":config_grid[2,2],
"y2_scale":config_grid[2,3],
"x_min":config_grid[3,1],
"y1_min":config_grid[3,2],
"y2_min":config_grid[3,3],
"x_max":config_grid[4,1],
"y1_max":config_grid[4,2],
"y2_max":config_grid[4,3],
"manual":config_grid[0,:]
}
return config_grid,config_dict
\ No newline at end of file
%% Cell type:code id:81f37cac-ea14-4540-8bc9-78bee248dfbb tags: %% Cell type:code id:81f37cac-ea14-4540-8bc9-78bee248dfbb tags:
``` python ``` python
import sys import sys
sys.path.insert(0, './lib') sys.path.insert(0, './lib')
sys.path.insert(0, '..') #append parent directory sys.path.insert(0, '..') #append parent directory
from interface import * from interface import *
from help import * from help import *
``` ```
%% Cell type:code id:731635ba-6f97-4a65-ad78-ae90b277544b tags: %% Cell type:code id:731635ba-6f97-4a65-ad78-ae90b277544b tags:
``` python ``` python
# Create the grids # Create the grids
#create the information grid #create the information grid
style = {'description_width': 'initial'} style = {'description_width': 'initial'}
sample,smu = information_box_new() sample,smu = information_box_new()
###end of sampling information####################################### ###end of sampling information#######################################
# move checkboxes outside of the tabs # move checkboxes outside of the tabs
transfer_check,integration_transfer,transfer_gates = header('Transfer Curve',"MEDium") transfer_check,integration_transfer,transfer_gates = header('Transfer Curve',"MEDium")
output_check,integration_output,output_gates = header('Output Curve',"SHORt") output_check,integration_output,output_gates = header('Output Curve',"SHORt")
gatediode_check,integration_gatediode,_=header('Gatediode',"MEDium") gatediode_check,integration_gatediode,_=header('Gatediode',"MEDium")
checkboxes = widgets.HBox([transfer_check,output_check,gatediode_check]) checkboxes = widgets.HBox([transfer_check,output_check,gatediode_check])
display(checkboxes) display(checkboxes)
#transfer #transfer
Vds_transfer_widgets,Vds_transfer = secondary('VDS',0.05,0.95,1,1e-2) Vds_transfer_widgets,Vds_transfer = secondary('VDS',0.05,0.95,1,1e-2)
Vtg_transfer_widgets,Vtg_transfer = primary('VTG',-5,0.01,5,1e-3) Vtg_transfer_widgets,Vtg_transfer = primary('VTG',-5,0.01,5,1e-3)
Vbg_transfer_widgets,Vbg_transfer = synchronous('VBG',-15,0.1,15,1e-3) Vbg_transfer_widgets,Vbg_transfer = synchronous('VBG',-15,0.1,15,1e-3)
replot_transfer_widgets,replot_transfer = replot() plot_transfer_widgets,plot_transfer = plot_config(1,"VTG","IDmm")
transfer_box = widgets.VBox([integration_transfer,transfer_gates,Vds_transfer_widgets,Vtg_transfer_widgets,Vbg_transfer_widgets,replot_transfer_widgets]) transfer_box = widgets.VBox([integration_transfer,transfer_gates,Vds_transfer_widgets,Vtg_transfer_widgets,Vbg_transfer_widgets,plot_transfer_widgets])
#output #output
Vds_output_widgets,Vds_output = primary('VDS',0,0.01,5,1e-2) Vds_output_widgets,Vds_output = primary('VDS',0,0.01,5,1e-2)
Vtg_output_widgets,Vtg_output = secondary('VTG',-5,2,5,1e-3) Vtg_output_widgets,Vtg_output = secondary('VTG',-5,2,5,1e-3)
Vbg_output_widgets,Vbg_output = additional_secondary('VBG',-15,5,15,1e-3) Vbg_output_widgets,Vbg_output = additional_secondary('VBG',-15,5,15,1e-3)
replot_output_widgets,replot_output = replot() plot_output_widgets,plot_output = plot_config(2,"VDS","IDmm")
output_box = widgets.VBox([integration_output,output_gates,Vds_output_widgets,Vtg_output_widgets,Vbg_output_widgets,replot_output_widgets]) output_box = widgets.VBox([integration_output,output_gates,Vds_output_widgets,Vtg_output_widgets,Vbg_output_widgets,plot_output_widgets])
#GateDiodde #GateDiodde
terminal = widgets.Dropdown( terminal = widgets.Dropdown(
options = ['VTG','VBG'], options = ['VTG','VBG'],
description = 'Selected Gate:', description = 'Selected Gate:',
value ='VTG', value ='VTG',
style= {'description_width': 'initial'} style= {'description_width': 'initial'}
) )
Vg_gatediode_widgets,Vg_gatediode=primary('VG',-5,0.05,5,1e-3) Vg_gatediode_widgets,Vg_gatediode=primary('VG',-5,0.05,5,1e-3)
replot_gatediode_widgets,replot_gatediode = replot() plot_gatediode_widgets,plot_gatediode = plot_config(3,"VTG","ITGmm")
gatediode_box = widgets.VBox([integration_gatediode,terminal,Vg_gatediode_widgets,replot_gatediode_widgets]) gatediode_box = widgets.VBox([integration_gatediode,terminal,Vg_gatediode_widgets,plot_gatediode_widgets])
#replot
replot__transfer_widgets,replot_transfer= replot("Transfer")
#the tab widget #the tab widget
children = [transfer_box,output_box,gatediode_box] children = [transfer_box,output_box,gatediode_box,replot_widgets]
titles = ["Transfer","Output","Gatediode"] titles = ["Transfer","Output","Gatediode","Replot"]
tab = widgets.Tab() tab = widgets.Tab()
tab.children = children tab.children = children
tab.titles = titles tab.titles = titles
display(tab) display(tab)
button = widgets.Button(description ='Start Measurement') button = widgets.Button(description ='Start Measurement')
output = widgets.Output() output = widgets.Output()
export_ini_button = widgets.Button(description = 'Export as ini') export_ini_button = widgets.Button(description = 'Export as ini')
import_ini_button = widgets.Button(description='Import from ini') import_ini_button = widgets.Button(description='Import from ini')
replot_button = widgets.Button(description = 'Replot',disabled = True) replot_button = widgets.Button(description = 'Replot',disabled = True)
all_widgets =[transfer_gates,output_gates,button,transfer_check,integration_transfer,output_check,integration_output,gatediode_check,integration_gatediode,terminal,export_ini_button,import_ini_button] all_widgets =[transfer_gates,output_gates,button,transfer_check,integration_transfer,output_check,integration_output,gatediode_check,integration_gatediode,terminal,export_ini_button,import_ini_button]
replot_widgets = [replot_transfer,replot_output,replot_gatediode,replot_button]
add_widgets_to_list(sample,all_widgets) add_widgets_to_list(sample,all_widgets)
add_widgets_to_list(smu,all_widgets) add_widgets_to_list(smu,all_widgets)
add_widgets_to_list(Vds_transfer,all_widgets) add_widgets_to_list(Vds_transfer,all_widgets)
add_widgets_to_list(Vtg_transfer,all_widgets) add_widgets_to_list(Vtg_transfer,all_widgets)
add_widgets_to_list(Vbg_transfer,all_widgets) add_widgets_to_list(Vbg_transfer,all_widgets)
add_widgets_to_list(Vds_output,all_widgets) add_widgets_to_list(Vds_output,all_widgets)
add_widgets_to_list(Vtg_output,all_widgets) add_widgets_to_list(Vtg_output,all_widgets)
add_widgets_to_list(Vbg_output,all_widgets) add_widgets_to_list(Vbg_output,all_widgets)
add_widgets_to_list(Vg_gatediode,all_widgets) add_widgets_to_list(Vg_gatediode,all_widgets)
line = widgets.HBox([button,import_ini_button,export_ini_button,replot_button]) line = widgets.HBox([button,import_ini_button,export_ini_button,replot_button])
display(line,output) display(line,output)
``` ```
%% Output %% Output
%% Cell type:code id:ed53d9c4-9e84-4675-b544-c6f4e2911229 tags: %% Cell type:code id:6578e563-4bd8-4191-9410-aec1858c72a6 tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment