aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2022-04-05 23:44:00 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2022-04-05 23:44:00 -0400
commitc25ee7e20279e2394186c3f7af3fd11f4e187c30 (patch)
treed101f05cc2b551a1205d83afbbb91740ca1d8819
parent09bcb72f34a37d0bc946fb8e21169d827d4bc5eb (diff)
downloadqolab-c25ee7e20279e2394186c3f7af3fd11f4e187c30.tar.gz
qolab-c25ee7e20279e2394186c3f7af3fd11f4e187c30.zip
added progress bars
-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)