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
2bcb4e48
Commit
2bcb4e48
authored
3 months ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
non interactive plots
parent
10449c07
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
-33
32 additions, 33 deletions
hp4194/cv.py
hp4194/cv_interace.ipynb
+1
-2
1 addition, 2 deletions
hp4194/cv_interace.ipynb
with
33 additions
and
35 deletions
hp4194/cv.py
+
32
−
33
View file @
2bcb4e48
...
@@ -2,7 +2,7 @@ from interface import *
...
@@ -2,7 +2,7 @@ from interface import *
import
control
import
control
from
help
import
*
from
help
import
*
import
time
import
time
from
IPython.display
import
clear_output
from
IPython.display
import
clear_output
,
display
import
numpy
as
np
import
numpy
as
np
import
datetime
import
datetime
import
pandas
as
pd
import
pandas
as
pd
...
@@ -157,10 +157,9 @@ def on_measure_clicked(b):
...
@@ -157,10 +157,9 @@ 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
'
)
for
bias
in
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
...
@@ -227,30 +226,31 @@ def on_measure_clicked(b):
...
@@ -227,30 +226,31 @@ def on_measure_clicked(b):
# do the plots
# do the plots
# first the live ones
# first the live ones
if
i
>
1
:
curve1
.
pop
(
0
).
remove
()
curve1_twin
.
pop
(
0
).
remove
()
curve2
.
pop
(
0
).
remove
()
curve2_twin
.
pop
(
0
).
remove
()
curve3
.
pop
(
0
).
remove
()
#clear the live axes
ax1
.
clear
()
ax1_twin
.
clear
()
ax2
.
clear
()
ax2_twin
.
clear
()
ax3
.
clear
()
# frequency Cp/D plot
# frequency Cp/D plot
ax1
.
plot
(
freq
,
Cp
,
color
=
'
b
'
)
curve1
=
ax1
.
plot
(
freq
,
Cp
,
color
=
'
b
'
)
ax1
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax1
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax1_twin
.
plot
(
freq
,
D
,
color
=
'
y
'
)
curve1_twin
=
ax1_twin
.
plot
(
freq
,
D
,
color
=
'
y
'
)
ax1_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
ax1_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
# frequecy Z-phi
# frequecy Z-phi
ax2
.
plot
(
freq
,
Z
,
color
=
'
b
'
)
curve2
=
ax2
.
plot
(
freq
,
Z
,
color
=
'
b
'
)
ax2
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax2
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax2_twin
.
plot
(
freq
,
phi
,
color
=
'
y
'
)
curve2_twin
=
ax2_twin
.
plot
(
freq
,
phi
,
color
=
'
y
'
)
ax2_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
ax2_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
# Rez - Imz
# Rez - Imz
ax3
.
plot
(
ReZ
,
ImZ
,
color
=
'
b
'
)
curve3
=
ax3
.
plot
(
ReZ
,
ImZ
,
color
=
'
b
'
)
ax3
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax3
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
# now the rest of the plots
# now the rest of the plots
...
@@ -280,10 +280,12 @@ def on_measure_clicked(b):
...
@@ -280,10 +280,12 @@ 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
'
)
plt
.
pause
(
0.1
)
display
(
fig
)
if
messparameter_dict
[
"
hysterisis
"
].
value
==
True
:
if
messparameter_dict
[
"
hysterisis
"
].
value
==
True
:
reversed_biases
=
reversed_array
(
biases
)
reversed_biases
=
reversed_array
(
biases
)
for
bias
in
reversed_biases
:
for
bias
in
reversed_biases
:
clear_output
(
wait
=
True
)
view
[
"
v-value
"
].
value
=
str
(
bias
)
view
[
"
v-value
"
].
value
=
str
(
bias
)
# voltage index
# voltage index
...
@@ -350,29 +352,28 @@ def on_measure_clicked(b):
...
@@ -350,29 +352,28 @@ def on_measure_clicked(b):
# do the plots
# do the plots
# first the live ones
# first the live ones
#clear the live axes
curve1
.
pop
(
0
).
remove
()
ax1
.
clear
()
curve1_twin
.
pop
(
0
).
remove
()
ax1_twin
.
clear
()
curve2
.
pop
(
0
).
remove
()
ax2
.
clear
()
curve2_twin
.
pop
(
0
).
remove
()
ax2_twin
.
clear
()
curve3
.
pop
(
0
).
remove
()
ax3
.
clear
()
# frequency Cp/D plot
# frequency Cp/D plot
ax1
.
plot
(
freq
,
Cp
,
color
=
'
b
'
)
curve1
=
ax1
.
plot
(
freq
,
Cp
,
color
=
'
b
'
)
ax1
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax1
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax1_twin
.
plot
(
freq
,
D
,
color
=
'
y
'
)
curve1_twin
=
ax1_twin
.
plot
(
freq
,
D
,
color
=
'
y
'
)
ax1_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
ax1_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
# frequecy Z-phi
# frequecy Z-phi
ax2
.
plot
(
freq
,
Z
,
color
=
'
b
'
)
curve2
=
ax2
.
plot
(
freq
,
Z
,
color
=
'
b
'
)
ax2
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax2
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax2_twin
.
plot
(
freq
,
phi
,
color
=
'
y
'
)
curve2_twin
=
ax2_twin
.
plot
(
freq
,
phi
,
color
=
'
y
'
)
ax2_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
ax2_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
y
'
)
# Rez - Imz
# Rez - Imz
ax3
.
plot
(
ReZ
,
ImZ
,
color
=
'
b
'
)
curve3
=
ax3
.
plot
(
ReZ
,
ImZ
,
color
=
'
b
'
)
ax3
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
ax3
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
b
'
)
# now the rest of the plots
# now the rest of the plots
...
@@ -401,10 +402,8 @@ def on_measure_clicked(b):
...
@@ -401,10 +402,8 @@ def on_measure_clicked(b):
ax6_twin
.
scatter
(
freq
,
D
,
color
=
'
r
'
)
ax6_twin
.
scatter
(
freq
,
D
,
color
=
'
r
'
)
ax6_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
r
'
)
ax6_twin
.
tick_params
(
axis
=
'
y
'
,
labelcolor
=
'
r
'
)
display
(
fig
)
plt
.
pause
(
0.1
)
plt
.
show
()
device
.
write
(
'
bias_off
'
)
device
.
write
(
'
bias_off
'
)
# save to file
# save to file
...
...
This diff is collapsed.
Click to expand it.
hp4194/cv_interace.ipynb
+
1
−
2
View file @
2bcb4e48
...
@@ -50,7 +50,6 @@
...
@@ -50,7 +50,6 @@
}
}
],
],
"source": [
"source": [
"%matplotlib tk\n",
"%run cv.py"
"%run cv.py"
]
]
},
},
...
@@ -79,7 +78,7 @@
...
@@ -79,7 +78,7 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.1
3
.0"
"version": "3.1
2
.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
%
matplotlib
tk
%
run
cv
.
py
%
run
cv
.
py
```
```
%% Output
%% Output
%% Cell type:code id:4f6be5c3-0ab8-4f18-88f6-02ce464a99f7 tags:
%% Cell type:code id:4f6be5c3-0ab8-4f18-88f6-02ce464a99f7 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