Skip to content
Snippets Groups Projects
Commit 88cbbf10 authored by JupyterHub User's avatar JupyterHub User
Browse files

added innen radious plot diagramms and lists with all the values

parent e784860c
No related branches found
No related tags found
No related merge requests found
......@@ -237,7 +237,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.9.7"
}
},
"nbformat": 4,
......
......@@ -62,7 +62,8 @@ def I_V_Measurement(start,stop,step):
#exporting the data frame in an excel file
file_name ="results.csv"
path = r"C:\Users\user\Desktop"
path = r"\\fileserver.cst.rwth-aachen.de\public\Datentransfer\Asonitis, Alexandros"
#r"C:\Users\user\Desktop"
directory = os.path.join(path,file_name)
df.to_csv(directory)
......@@ -141,7 +142,7 @@ def stress_sampling(V2_stress=10,V3_stress=3,stress_time=30,V2_sampling=10,V3_sa
#prepare full measurement
def ctlm(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),comp=10,distances=(5,10,15,25,45),time='MED'):
def ctlm(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),comp=10,distances=(5,10,15,25,45),time='MED',innen=0):
#connect to the device
device = module.HP4155a('GPIB0::17::INSTR')
......@@ -153,6 +154,10 @@ def ctlm(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),com
plt.ylabel('Current(A)')
plt.title("CTLM plot")
#lists for appending all data values
ctlm_voltage = []
ctlm_current = []
ctlm_resistance = []
#execute five measurements
for j in range(len(distances)):
......@@ -203,6 +208,9 @@ def ctlm(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),com
voltage_values = device.return_data('V3')
current_values = device.return_data('I3')
ctlm_voltage.append(voltage_values)
ctlm_current.append(current_values)
resistance_values=[]
for i in range(len(voltage_values)):
......@@ -221,7 +229,7 @@ def ctlm(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),com
print(df)
file_name = field_name+"_CTLM_"+str(j+1)+".txt"
path =r"C:\Users\user\Desktop"
path =r"\\fileserver.cst.rwth-aachen.de\public\Datentransfer\Asonitis, Alexandros"
directory = os.path.join(path,file_name)
#export DataFrame to text file (keep header row and index column)
f=open(directory, 'a')
......@@ -229,6 +237,10 @@ def ctlm(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),com
df_string = df.to_string()
f.write(df_string)
#plot diagramm
plt.legend()
plt.show()
#wait for confirmation from user after a measurement is done
while True:
answer = input('please press enter to continue with the next measurement or finish after the last measurement!')
......@@ -236,7 +248,5 @@ def ctlm(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3),com
break
#close the connection and plot all the diagramms
plt.legend()
plt.show()
del device
......@@ -182,6 +182,7 @@ class HP4155a(object):
#set normal compliance for VAR1 and VAR2
def comp(self,variable,value):
""" """
command = f":PAGE:MEAS:{variable}:COMP {value}"
self.inst.write(command)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment