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

part2

parent 534d7474
No related branches found
No related tags found
No related merge requests found
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.11.4" "version": "3.9.7"
} }
}, },
"nbformat": 4, "nbformat": 4,
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -7,6 +7,7 @@ from datetime import datetime ...@@ -7,6 +7,7 @@ from datetime import datetime
import os import os
from sklearn.linear_model import LinearRegression from sklearn.linear_model import LinearRegression
import sys import sys
import numpy as np
def I_V_Measurement(start,stop,step): def I_V_Measurement(start,stop,step):
...@@ -277,9 +278,20 @@ def tlm_final(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3 ...@@ -277,9 +278,20 @@ def tlm_final(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3
#connect to the device #connect to the device
device = module.HP4155a('GPIB0::17::INSTR') device = module.HP4155a('GPIB0::17::INSTR')
date = str(datetime.today().replace(microsecond=0)) date = str(datetime.today().replace(microsecond=0))
voltage=[]
current=[]
restistance=[]
#initialize figure
fig, (ax1, ax2) = plt.subplots(2,sharex=True) #the plots share the same x axis
fig.suptitle('CTLM plot')
ax1.set_title('I(V)')
ax1.set(xlabel='Voltage(V)',ylabel='Current(A)')
ax2.set_title('R(V)')
ax2.set(xlabel='Voltage(V)',ylabel='Resistance(Ohm)')
#repeat five times #repeat five times
for i in range(len(distances)): for j in range(len(distances)):
#setup #setup
device.reset() device.reset()
device.inst.write(":PAGE:MEAS") device.inst.write(":PAGE:MEAS")
...@@ -348,6 +360,20 @@ def tlm_final(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3 ...@@ -348,6 +360,20 @@ def tlm_final(field_name ='M00',start=-50*10**(-3),stop=50*10**(-3),step=10**(-3
while device.operation_completed() == False: while device.operation_completed() == False:
pass pass
#return data from the device
V=device.return_data('V')
I=device.return_data('I')
R=device.return_data('R')
# now we have to remove resistance values that R=inf(nan) that means that the current is zero
for i in range(len(R)):
if R[i]>10**6:
R[i]=float('NAN')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment