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

adding header with averagfe and ptp currents and voltages

parent 9863d912
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
......@@ -492,7 +492,9 @@ while True:
print("Live view stopped")
```
<!-- #region hide_input=true -->
# Power Spectral Density Live Display
<!-- #endregion -->
```python hide_input=true
# The traces we download
......@@ -505,6 +507,11 @@ I_psd = []
V_psd = []
f = []
I_avg = 0
I_ptp = 0
V_avg = 0
V_ptp = 0
# Each PSD trace is 8193 points long
n_psd = 8193
nmax = 100
......@@ -517,6 +524,7 @@ n_filled = 0
def update_display():
global I,V,t,f,I_psd,V_psd,last_trace_time,ind_next,n_filled
global I_avg, I_ptp, V_avg, V_ptp
I,V,t = get_IV_t(decimation=decimation.value)
I_avg = np.average(I)
I_ptp = np.max(I) - np.min(I)
......@@ -633,6 +641,7 @@ freq_stop = widgets.FloatText(value=1e5,description="Stop (Hz)")
def save_data(w):
fmt = f"mrsquid_PSD_%Y-%m-%d-%H_%M_%S.dat"
header = "# I_avg %e I_ptp %e V_avg %e V_ptp %e" % (I_avg, I_ptp, V_avg, V_ptp )
outname = folder + "/" + datetime.now().strftime(fmt)
np.savetxt(outname, np.array([f,I_psd,V_psd]).T)
filename.value = outname
......
%% Cell type:code id: tags:
``` python
import os
import shutil
```
%% Cell type:markdown id: tags:
Using this, we can just make edits to the software in the folder where the students will run it and use this to get a copy of the updated code into the git repo.
%% Cell type:code id: tags:
``` python
os.remove("SQUID measurement software.ipynb")
os.remove("SQUID measurement software.md")
source = "../../../Delft University of Technology/TN2953-P QN Squid Practicum - data/SQUID measurement software.ipynb"
shutil.copy2(source, ".")
```
%% Output
'.\\SQUID measurement software.ipynb'
%% Cell type:code id: tags:
``` python
```
......
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