aboutsummaryrefslogtreecommitdiff
path: root/qolab
diff options
context:
space:
mode:
Diffstat (limited to 'qolab')
-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