aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/eit_with_vcsel.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/examples/eit_with_vcsel.py b/examples/eit_with_vcsel.py
index b852f42..775f2e6 100644
--- a/examples/eit_with_vcsel.py
+++ b/examples/eit_with_vcsel.py
@@ -2,6 +2,7 @@ import pyvisa
import numpy as np
import platform
import time
+from tqdm import tqdm as pbar
from qolab.data import TraceSetSameX, TraceXY, Trace
@@ -32,7 +33,7 @@ ps.setChanIout(2, 0.070173)
ps.setChanIout(3, 0.01057)
print('Done setting magnetic field coils currents')
-def eitSweep(central_frequency, frequency_span, Np):
+def eitSweep(central_frequency, frequency_span, Np, Nsweeps=1):
frList = np.linspace(central_frequency-frequency_span/2, central_frequency+frequency_span/2, Np)
trFreq=Trace('Frequency')
trFreq.config['unit']='Hz'
@@ -43,16 +44,16 @@ def eitSweep(central_frequency, frequency_span, Np):
trEIT = TraceSetSameX('EIT')
- for fr in frList:
- print(fr)
- rfgen.setFreqFixed(fr)
- time.sleep(dwellTime)
- transmission = daq.getAIN(0)
- lockin = daq.getAIN(1)
+ for sw in pbar(range(1,Nsweeps+1), desc="Sweep"):
+ for fr in pbar(frList, desc="Freq Scan"):
+ rfgen.setFreqFixed(fr)
+ time.sleep(dwellTime)
+ transmission = daq.getAIN(0)
+ lockin = daq.getAIN(1)
- trFreq.addPoint(fr)
- trTransmission.addPoint(transmission)
- trLockin.addPoint(lockin)
+ trFreq.addPoint(fr)
+ trTransmission.addPoint(transmission)
+ trLockin.addPoint(lockin)
trFreq.values = trFreq.values - central_frequency
trEIT.addTraceX(trFreq)