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

first files for transfer and input

parent 37c15c0d
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:6defdb49-06c2-469d-beb5-bc2e147e3f79 tags: %% Cell type:code id:6defdb49-06c2-469d-beb5-bc2e147e3f79 tags:
``` python ``` python
%run ADU.py %run ADU.py
``` ```
%% Output %% Output
%% Cell type:code id:9ca55782-244e-4308-868e-8a6bba5897ab tags: %% Cell type:code id:3da7c505-85a3-45e9-853e-86a9c9e30569 tags:
``` python
change_state(all_widgets)
```
%% Cell type:code id:303f03c1-9447-484e-9bc8-07f00db4607a tags:
``` python ``` python
``` ```
......
...@@ -110,17 +110,19 @@ def on_start_clicked(b): ...@@ -110,17 +110,19 @@ def on_start_clicked(b):
smu4.update(vname ='VS2',iname = 'IS2',mode = 'COMM',func='CONS') smu4.update(vname ='VS2',iname = 'IS2',mode = 'COMM',func='CONS')
#execute measurement #execute measurement
Vgs,Vds,Idmm,gm=Transfer(smu1,smu2,smu3,smu4,integration_transfer.value,device) Vgs,Vds,Idmm,gm,Igmm=Transfer(smu1,smu2,smu3,smu4,integration_transfer.value,device)
#plot results #plot results
clear_output() clear_output()
plot_transfer(Vgs,Idmm,gm,points) plot_transfer(Vgs,Idmm,gm,points)
#save results #save results
header=['VGS(V)','VDS(V)','IDmm(mA/mm)','gm(mS/mm)'] header=['VGS(V)','VDS(V)','IDmm(mA/mm)',"IGmm(mA/mm)",'gm(mS/mm)']
data = {header[0]:Vgs,header[1]:Vds,header[2]:Idmm,header[3]:gm} data = {header[0]:Vgs,header[1]:Vds,header[2]:Idmm,header[3]:Igmm,header[4]:gm}
df = pd.DataFrame(data) df = pd.DataFrame(data)
#write to file #write to file
filename = f"" filename = f"{sample['sample'].value}_{sample['field'].value}_{sample['device'].value}U.txt"
file = create_file(filename)
save_to_file('Transfer Curve',file,df,sample,integration_transfer,Vgs_transfer,Vds_transfer)
if output_check.value == True: if output_check.value == True:
vds_ok = check_values(Vds_output['start'],Vds_output['step'],Vds_output['stop'],'primary') vds_ok = check_values(Vds_output['start'],Vds_output['step'],Vds_output['stop'],'primary')
...@@ -172,7 +174,17 @@ def on_start_clicked(b): ...@@ -172,7 +174,17 @@ def on_start_clicked(b):
clear_output() clear_output()
plot_output(Vds,Idmm,Igmm,points) plot_output(Vds,Idmm,Igmm,points)
#save results(later) #save results
header=['VGS(V)','VDS(V)','IDmm(mA/mm)',"IGmm(mA/mm)"]
data = {header[0]:Vgs,header[1]:Vds,header[2]:Idmm,header[3]:Igmm}
df = pd.DataFrame(data)
#write to file
filename = f"{sample['sample'].value}_{sample['field'].value}_{sample['device'].value}A.txt"
file = create_file(filename)
save_to_file('Output Curve',file,df,sample,integration_output,Vgs_output,Vds_output)
button.on_click(on_start_clicked) button.on_click(on_start_clicked)
......
...@@ -5,6 +5,8 @@ import tkinter as tk ...@@ -5,6 +5,8 @@ import tkinter as tk
from tkinter import filedialog from tkinter import filedialog
import tkinter.messagebox import tkinter.messagebox
import pandas as pd
def plot_transfer(x,y1,y2,curves): def plot_transfer(x,y1,y2,curves):
x = np.array_split(x,curves) x = np.array_split(x,curves)
...@@ -177,12 +179,43 @@ def create_file(filename): ...@@ -177,12 +179,43 @@ def create_file(filename):
file = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text files","*.txt")],title = "save results path",initialfile =filename) file = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text files","*.txt")],title = "save results path",initialfile =filename)
#check if the file path is correct(.txt) #check if the file path is correct(.txt)
while target_file.endswith(".txt") == False: while file.endswith(".txt") == False:
#open again filedialog with error message box #open again filedialog with error message box
tk.messagebox.showerror(message='invalid filename!') tk.messagebox.showerror(message='invalid filename!')
file = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text files","*.txt")],title = "save results path",initialfile =filename) file = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text files","*.txt")],title = "save results path",initialfile =filename)
root.destroy() root.destroy()
return file return file
def save_to_file(measurement,file,df,sample,integration,Vgs,Vds=None):
with open(file,'w') as f:
f.write(f"{measurement}"+"\n")
f.write(f"Processing number:{sample['processing_number'].value}"+"\n")
f.write(f"Sample:{sample['sample'].value}"+"\n")
f.write(f"Field:{sample['field'].value}"+"\n")
f.write(f"Device:{sample['device'].value}"+"\n")
f.write(f"Device Width(µm):{sample['width'].value}"+"\n\n")
f.write('Parameters\n')
f.write(f'Integration time:{integration.value}'+"\n")
#calculate the values
Vgs_comp=Vgs["comp"].value
Vgs_pcomp=Vgs["pcomp"].value
if Vgs_pcomp==0:
f.write(f"Gate Current Compliance(A):{Vgs_comp}"+"\n")
else:
f.write(f"Gate Power Compliance(A):{Vgs_pcomp}"+"\n")
if Vds!=None:
Vds_comp=Vds["comp"].value
Vds_pcomp=Vds["pcomp"].value
if Vds_pcomp ==0:
f.write(f"Drain Current Compliance(A):{Vds_comp}"+"\n")
else:
f.write(f"Drain Power Compliance(A):{Vds_pcomp}"+"\n")
f.write("\nResults\n")
f.write(df.to_string())
\ No newline at end of file
...@@ -96,8 +96,9 @@ def Transfer(smu1,smu2,smu3,smu4,integration,device): ...@@ -96,8 +96,9 @@ def Transfer(smu1,smu2,smu3,smu4,integration,device):
Idmm=device.return_values('IDmm') Idmm=device.return_values('IDmm')
gm=device.return_values('Gm') gm=device.return_values('Gm')
Vds= device.return_values('VDS') Vds= device.return_values('VDS')
Igmm = device.return_values('IGmm')
return Vgs,Vds,Idmm,gm return Vgs,Vds,Idmm,gm,Igmm
def Output(smu1,smu2,smu3,smu4,integration,device): def Output(smu1,smu2,smu3,smu4,integration,device):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment