aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/scope/_basic.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-23 15:42:45 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-23 15:42:45 -0400
commitf33f507af90cc8255c5b4d2ffc0a1d4f5c13c83b (patch)
tree796ba0f82ffee38d0a689201b665e843b5ea46a1 /qolab/hardware/scope/_basic.py
parent671cfbbd5b5b91986a69e9e0a639a6adce1e3956 (diff)
downloadqolab-f33f507af90cc8255c5b4d2ffc0a1d4f5c13c83b.tar.gz
qolab-f33f507af90cc8255c5b4d2ffc0a1d4f5c13c83b.zip
black formatter
Diffstat (limited to 'qolab/hardware/scope/_basic.py')
-rw-r--r--qolab/hardware/scope/_basic.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py
index 4133c6e..861340d 100644
--- a/qolab/hardware/scope/_basic.py
+++ b/qolab/hardware/scope/_basic.py
@@ -175,7 +175,7 @@ class Scope(BasicInstrument):
starttime = time.time()
deadline = starttime + timeout
- timespan = self.getTimePerDiv()*self.horizDivOnScreen
+ timespan = self.getTimePerDiv() * self.horizDivOnScreen
scaled_corectly = False
# maximally zoom out to get full signal
self.setChanVoltageOffset(chNum, 0)
@@ -183,7 +183,9 @@ class Scope(BasicInstrument):
self.setRun(True)
while (not scaled_corectly) and (time.time() < deadline):
- time.sleep(timespan + 0.5) # give enough time to acquire a trace and switch to Run
+ time.sleep(
+ timespan + 0.5
+ ) # give enough time to acquire a trace and switch to Run
tr = self.getTrace(chNum)
vPerDiv = self.getChanVoltsPerDiv(chNum)
offset = self.getChanVoltageOffset(chNum)
@@ -195,8 +197,8 @@ class Scope(BasicInstrument):
tr_min = y.min()
margin_t = (v_max - tr_max) / v_range
margin_b = (tr_min - v_min) / v_range
- is_margin_t_good = (margin_t > margin * 0.5) and (margin_t < margin*0.6)
- is_margin_b_good = (margin_b > margin * 0.5) and (margin_b < margin*0.6)
+ is_margin_t_good = (margin_t > margin * 0.5) and (margin_t < margin * 0.7)
+ is_margin_b_good = (margin_b > margin * 0.5) and (margin_b < margin * 0.7)
if (is_margin_b_good) and (is_margin_t_good):
scaled_corectly = True
break