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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
ed8b0e01
Commit
ed8b0e01
authored
3 months ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
First version ready
parent
2bcb4e48
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
hp4194/cv.py
+32
-11
32 additions, 11 deletions
hp4194/cv.py
hp4194/cv_interace.ipynb
+5
-5
5 additions, 5 deletions
hp4194/cv_interace.ipynb
with
37 additions
and
16 deletions
hp4194/cv.py
+
32
−
11
View file @
ed8b0e01
import
matplotlib
matplotlib
.
use
(
'
TkAgg
'
,
force
=
True
)
from
interface
import
*
from
interface
import
*
import
control
import
control
from
help
import
*
from
help
import
*
...
@@ -114,7 +117,7 @@ def on_measure_clicked(b):
...
@@ -114,7 +117,7 @@ def on_measure_clicked(b):
f_index
=
messparameter_dict
[
'
f_point
'
].
value
-
1
f_index
=
messparameter_dict
[
'
f_point
'
].
value
-
1
# create the figure
# create the figure
fig
=
plt
.
figure
(
figsize
=
(
1
5
,
9
),
layout
=
"
constrained
"
)
fig
=
plt
.
figure
(
figsize
=
(
1
2
,
10
),
layout
=
"
constrained
"
)
spec
=
fig
.
add_gridspec
(
ncols
=
3
,
nrows
=
2
)
spec
=
fig
.
add_gridspec
(
ncols
=
3
,
nrows
=
2
)
ax1
=
fig
.
add_subplot
(
spec
[
0
,
0
])
ax1
=
fig
.
add_subplot
(
spec
[
0
,
0
])
...
@@ -157,9 +160,13 @@ def on_measure_clicked(b):
...
@@ -157,9 +160,13 @@ def on_measure_clicked(b):
ax6
.
set_ylabel
(
"
Cp (F)
"
)
ax6
.
set_ylabel
(
"
Cp (F)
"
)
ax6_twin
.
set_ylabel
(
"
D
"
)
ax6_twin
.
set_ylabel
(
"
D
"
)
"""
figManager = plt.get_current_fig_manager()
figManager.window.state(
'
zoomed
'
)
win = plt.gcf().canvas.manager.window
win.overrideredirect(1)
"""
view
[
"
v-point
"
].
value
=
str
(
biases
[
messparameter_dict
[
"
v_point
"
].
value
-
1
])
for
i
,
bias
in
enumerate
(
biases
):
for
i
,
bias
in
enumerate
(
biases
):
clear_output
(
wait
=
True
)
view
[
"
v-value
"
].
value
=
str
(
bias
)
view
[
"
v-value
"
].
value
=
str
(
bias
)
# voltage index
# voltage index
...
@@ -180,7 +187,7 @@ def on_measure_clicked(b):
...
@@ -180,7 +187,7 @@ def on_measure_clicked(b):
B
=
np
.
array
(
device
.
read_register
(
'
reg_B
'
))
B
=
np
.
array
(
device
.
read_register
(
'
reg_B
'
))
B_values
.
extend
(
B
)
B_values
.
extend
(
B
)
view
[
"
f-point
"
].
value
=
str
(
freq
[
messparameter_dict
[
"
f_point
"
].
value
-
1
])
time
.
sleep
(
messparameter_dict
[
"
sleep
"
].
value
)
time
.
sleep
(
messparameter_dict
[
"
sleep
"
].
value
)
#do the calculations
#do the calculations
...
@@ -226,7 +233,7 @@ def on_measure_clicked(b):
...
@@ -226,7 +233,7 @@ def on_measure_clicked(b):
# do the plots
# do the plots
# first the live ones
# first the live ones
if
i
>
1
:
if
i
>
0
:
curve1
.
pop
(
0
).
remove
()
curve1
.
pop
(
0
).
remove
()
curve1_twin
.
pop
(
0
).
remove
()
curve1_twin
.
pop
(
0
).
remove
()
curve2
.
pop
(
0
).
remove
()
curve2
.
pop
(
0
).
remove
()
...
@@ -280,7 +287,13 @@ def on_measure_clicked(b):
...
@@ -280,7 +287,13 @@ def on_measure_clicked(b):
ax6_twin
.
scatter
(
freq
,
D
,
color
=
'
y
'
)
ax6_twin
.
scatter
(
freq
,
D
,
color
=
'
y
'
)
ax6_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
ax6_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
display
(
fig
)
wm
=
plt
.
get_current_fig_manager
()
wm
.
window
.
state
(
'
zoomed
'
)
win
=
plt
.
gcf
().
canvas
.
manager
.
window
win
.
overrideredirect
(
1
)
# draws a completely frameless window
plt
.
pause
(
0.1
)
if
messparameter_dict
[
"
hysterisis
"
].
value
==
True
:
if
messparameter_dict
[
"
hysterisis
"
].
value
==
True
:
reversed_biases
=
reversed_array
(
biases
)
reversed_biases
=
reversed_array
(
biases
)
...
@@ -397,12 +410,20 @@ def on_measure_clicked(b):
...
@@ -397,12 +410,20 @@ def on_measure_clicked(b):
# This if for all the frequencies for the calculated voltage
# This if for all the frequencies for the calculated voltage
if
biases
[
v_index
]
==
bias
:
if
biases
[
v_index
]
==
bias
:
ax6
.
scatter
(
freq
,
Cp
,
color
=
'
g
'
)
ax6
.
scatter
(
freq
,
Cp
,
color
=
'
b
'
)
ax6
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
g
'
)
ax6
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax6_twin
.
scatter
(
freq
,
D
,
color
=
'
y
'
)
ax6_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
wm
=
plt
.
get_current_fig_manager
()
wm
.
window
.
state
(
'
zoomed
'
)
win
=
plt
.
gcf
().
canvas
.
manager
.
window
win
.
overrideredirect
(
1
)
# draws a completely frameless window
plt
.
pause
(
0.1
)
ax6_twin
.
scatter
(
freq
,
D
,
color
=
'
r
'
)
win
.
overrideredirect
(
0
)
ax6_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
r
'
)
display
(
fig
)
device
.
write
(
'
bias_off
'
)
device
.
write
(
'
bias_off
'
)
...
...
This diff is collapsed.
Click to expand it.
hp4194/cv_interace.ipynb
+
5
−
5
View file @
ed8b0e01
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
0c5bba2a5cce41b1b8513e407f69feb7
",
"model_id": "
5922ed122c8b4e82b4eae9959038b4bd
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
195674067b164d529b9645afaafa3021
",
"model_id": "
f803f463cf434773bfb596677188d79e
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
{
{
"data": {
"data": {
"application/vnd.jupyter.widget-view+json": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
a327e9646bee4cbdbfe82b7fbf83d0be
",
"model_id": "
9b25051b2f1a454ca1d7bdb39df52266
",
"version_major": 2,
"version_major": 2,
"version_minor": 0
"version_minor": 0
},
},
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": null,
"execution_count": null,
"id": "
4
f6b
e5c3-0ab8-4f18-88f6-02ce464a99f7
",
"id": "
f
f6b
31d5-6708-452e-b919-56bd104365e1
",
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": []
"source": []
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.1
2
.0"
"version": "3.1
3
.0"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
...
...
%% Cell type:code id:912606ea-a3b6-43e8-94c5-8f1fe5281375 tags:
%% Cell type:code id:912606ea-a3b6-43e8-94c5-8f1fe5281375 tags:
```
python
```
python
%
run
cv
.
py
%
run
cv
.
py
```
```
%% Output
%% Output
%% Cell type:code id:
4
f6b
e5c3-0ab8-4f18-88f6-02ce464a99f7
tags:
%% Cell type:code id:
f
f6b
31d5-6708-452e-b919-56bd104365e1
tags:
```
python
```
python
```
```
...
...
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