Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labcode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
d5b820fd
Commit
d5b820fd
authored
Sep 15, 2023
by
JupyterHub User
Browse files
Options
Downloads
Patches
Plain Diff
part2
parent
534d7474
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
hp4155/ctlm.ipynb
+1
-1
1 addition, 1 deletion
hp4155/ctlm.ipynb
hp4155/ctlm_part2.ipynb
+49
-512
49 additions, 512 deletions
hp4155/ctlm_part2.ipynb
hp4155/measurements.py
+27
-1
27 additions, 1 deletion
hp4155/measurements.py
with
77 additions
and
514 deletions
hp4155/ctlm.ipynb
+
1
−
1
View file @
d5b820fd
...
@@ -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,
...
...
This diff is collapsed.
Click to expand it.
hp4155/ctlm_part2.ipynb
+
49
−
512
View file @
d5b820fd
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
hp4155/measurements.py
+
27
−
1
View file @
d5b820fd
...
@@ -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
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment