Skip to main content
Sign in
Snippets Groups Projects
Commit 8f97dc40 authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

communication with the tool for plot established (user functions should be defined properly)

parent f91cc71c
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:51b012d0-95b0-41c2-81bb-2205f3c53be2 tags:
``` python
%matplotlib widget
%run double_gate_ADU.py
```
%% Output
%% Cell type:code id:1c664184-3c2a-4cbd-9ef2-b06084acd3b9 tags:
``` python
```
......
......
......@@ -239,15 +239,53 @@ def check_configuration(smu_map:dict):
raise Exception("You cannot assign a smu to multiple contacts")
#check error while setting plotting configurations
def check_error():
def check_error(device):
error_message =""
while True:
current_error = device.error()
if current_error=='0,"No error"':
if current_error=='+0,"No error"\n':
break
else :
error_message = error_message + current_error
if error_message != "":
raise Exception(error_message)
# The function for graph in the tool
def graph_tool(params):
device.delete_axis("X")
device.delete_axis("Y1")
device.delete_axis("Y2")
device.del_user_functions()
check_error(device)
# How to define user functions correctly and not multiple times
plot_list = [params["PLOT"]["x"],params["PLOT"]["y1"],params["PLOT"]["y2"]]
plot_set= set(plot_list)
for element in plot_set:
if element.endswith("mm"):
#define the respective user function
if params["PLOT"]["x"]!= None:
device.display_variable('X',params["PLOT"]["x"])
device.axis_scale('X',params["PLOT"]["x_scale"])
device.display_variable_min_max('X','MIN',params["PLOT"]["x_min"])
device.display_variable_min_max('X','MAX',params["PLOT"]["x_max"])
if params["PLOT"]["y1"]!= None:
device.display_variable('Y1',params["PLOT"]["y1"])
device.axis_scale('Y1',params["PLOT"]["y1_scale"])
device.display_variable_min_max('Y1','MIN',params["PLOT"]["y1_min"])
device.display_variable_min_max('Y1','MAX',params["PLOT"]["y1_max"])
if params["PLOT"]["y2"]!= None:
device.display_variable('Y2',params["PLOT"]["y2"])
device.axis_scale('X',params["PLOT"]["y2_scale"])
device.display_variable_min_max('X','MIN',params["PLOT"]["y2_min"])
device.display_variable_min_max('X','MAX',params["PLOT"]["y2_max"])
check_error(device)
\ No newline at end of file
......@@ -22,6 +22,11 @@ def Setup(device):
# Transfer only VTG
def Transfer_VTG(device,params):
# calculate normalization factor
norm = normalization_factor(params["SAMPLE"]["width"])
points = params["VAR2"]["points"]
device.setup_smu(params["MAP"]['TG'],params["SMU_T"])
device.setup_smu(params["MAP"]['D'],params["SMU_D"])
device.setup_smu(params["MAP"]['BG'],params["SMU_B"])
......@@ -31,9 +36,8 @@ def Transfer_VTG(device,params):
device.setup_var2(params["VAR2"])
device.integration_time(params["INTEGRATION"])
device.display_variable('X','VTG')
device.display_variable('Y1','ID')
device.display_variable('Y2','ITG')
variables_list =["VTG","ITG","VDS","ID"]
device.variables_to_save(variables_list)
......@@ -47,9 +51,7 @@ def Transfer_VTG(device,params):
values = dict([(variable,device.return_values(variable)) for variable in variables_list])
df = get_dataframe_from_results(values)
# calculate normalization factor
norm = normalization_factor(params["SAMPLE"]["width"])
points = params["VAR2"]["points"]
# Append the normalized current
df["IDmm/uA/um"]= (df["ID/A"].apply(lambda x: Decimal(str(x))*Decimal(str(norm)))).astype('float')
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment