Skip to content
Snippets Groups Projects
Commit 59ddfc8d authored by Mr. SQUID's avatar Mr. SQUID
Browse files

added ref curve = awesome

parent a026c507
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.2'
jupytext_version: 1.3.0
jupytext_version: 1.6.0
kernelspec:
display_name: Python 3
language: python
......@@ -128,7 +128,7 @@ for file in "autoplot.py", "Plot all my data.ipynb":
# IV vs Time Live Display
<!-- #endregion -->
```python hide_input=true
```python hide_input=false
I = []
V = []
t = []
......@@ -220,6 +220,10 @@ print("Live view done")
# IV Live Display
```python hide_input=true
I = []
V = []
t = []
def update_display():
global I,V,t
ipython.kernel.do_one_iteration()
......@@ -257,19 +261,27 @@ def update_display():
else:
slope_line.visible = False
if plot_ref_button.value:
ref_trace.visible = True
else:
ref_trace.visible = False
range1 = Range1d()
range2 = Range1d()
source1 = ColumnDataSource()
source2 = ColumnDataSource()
source3 = ColumnDataSource()
p1 = figure(title="IV", plot_height=500, plot_width=600,toolbar_location=None, x_range = range1, y_range = range2)
p1.yaxis.axis_label = 'Measured Voltage (uV)'
p1.xaxis.axis_label = 'Applied Current (uA)'
ref_trace = p1.line('x','y',source=source3, color='magenta')
ref_trace.visible = False
p1.line('x', 'y', source=source1)
slope_line = p1.line('x','y',source=source2, color='red')
slope_line.visible = False
x_full_scale = I_full_scale #uA
y_full_scale = V_full_scale # uV
......@@ -298,6 +310,15 @@ def fit_slope(w):
line_slope.value = coef[0]
fit_slope_button.on_click(fit_slope)
plot_ref_button = widgets.ToggleButton(description="Plot ref")
take_ref_button = widgets.Button(description="Take as ref")
def take_ref(w):
global source3, I, V
source3.data = dict(x=I, y=V)
take_ref_button.on_click(take_ref)
for w in (I_avg_w, V_avg_w, I_ptp_w, V_ptp_w, R_ptp_w, R_avg_w):
w.layout.width = '150px'
......@@ -312,6 +333,7 @@ save_button.on_click(save_data)
filename = widgets.HTML(description="Last filename: ",style=style)
filename.value = "(none)"
take_ref([])
update_display()
target = show(p1, notebook_handle=True)
rows = []
......@@ -319,6 +341,7 @@ rows = []
rows.append(widgets.HBox([I_avg_w, V_avg_w, R_avg_w]))
rows.append(widgets.HBox([I_ptp_w, V_ptp_w, R_ptp_w]))
rows.append(widgets.HBox([plot_line_button, line_slope, fit_slope_button]))
rows.append(widgets.HBox([plot_ref_button, take_ref_button]))
rows.append(widgets.HBox([save_button, filename]))
rows.append(widgets.HBox([stop_button,pause_button,scale_mode,mrsquid_mode]))
controls = widgets.VBox(rows)
......@@ -395,6 +418,8 @@ def take_measurement():
source2.data = dict(x=tm,y=R)
source3.data = dict(x=tm,y=T)
source4.data = dict(x=T,y=R)
p2.title.text = "R vs time R = %.2f Ohms" % R[-1]
p3.title.text = "T vs time T = %.2f K" % T[-1]
# The plots
......
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
......@@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"metadata": {},
"outputs": [
{
......@@ -28,7 +28,7 @@
"'.\\\\SQUID measurement software.ipynb'"
]
},
"execution_count": 9,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment