Skip to content
Snippets Groups Projects
Commit ed8b0e01 authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

First version ready

parent 2bcb4e48
No related branches found
No related tags found
No related merge requests found
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=(15,9),layout = "constrained") fig = plt.figure(figsize=(12,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')
......
%% 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:4f6be5c3-0ab8-4f18-88f6-02ce464a99f7 tags: %% Cell type:code id:ff6b31d5-6708-452e-b919-56bd104365e1 tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment