aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/scope/sds1104x.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-25 23:36:01 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-25 23:42:51 -0400
commitaf973de2068774a95308f77c7a5ff51d88a04ff4 (patch)
tree7b371d7f9920e71ca8f4ab8839d4d8286baeb4e9 /qolab/hardware/scope/sds1104x.py
parent618195ac9dee31d669155e8601ea2300427d8c1b (diff)
downloadqolab-af973de2068774a95308f77c7a5ff51d88a04ff4.tar.gz
qolab-af973de2068774a95308f77c7a5ff51d88a04ff4.zip
make Siglent sds1104x trace aquizition compatible with new config passing scheme
Diffstat (limited to 'qolab/hardware/scope/sds1104x.py')
-rw-r--r--qolab/hardware/scope/sds1104x.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/qolab/hardware/scope/sds1104x.py b/qolab/hardware/scope/sds1104x.py
index 21439e5..abca62a 100644
--- a/qolab/hardware/scope/sds1104x.py
+++ b/qolab/hardware/scope/sds1104x.py
@@ -92,15 +92,22 @@ class SDS1104X(ScopeSCPI):
to use ``decimate=True``.
"""
+ rawChanCfg = {}
if availableNpnts is None:
# using channel 1 to get availableNpnts
availableNpnts = self.getAvailableNumberOfPoints(1)
+ rawChanCfg["availableNpnts"] = availableNpnts
+
+ if maxRequiredPoints is None:
+ maxRequiredPoints = self.maxRequiredPoints
(
sparsing,
Npnts,
availableNpnts,
maxRequiredPoints,
) = calcSparsingAndNumPoints(availableNpnts, maxRequiredPoints)
+ rawChanCfg["Npnts"] = Npnts
+ rawChanCfg["sparsing"] = sparsing
if decimate:
Npnts = availableNpnts # get all of them and decimate later
if (sparsing == 1 and Npnts == availableNpnts) or decimate:
@@ -169,7 +176,8 @@ class SDS1104X(ScopeSCPI):
wfRaw = np.array([])
trRaw.config["unit"] = "Count"
trRaw.config["tags"]["Decimate"] = decimate
- return (trRaw, availableNpnts, Npnts)
+ trRaw.config["tags"]["rawChanConfig"] = rawChanCfg
+ return (trRaw, rawChanCfg)
def getChanVoltsPerDiv(self, chNum):
qstr = f"C{chNum}:VDIV?"
@@ -266,7 +274,7 @@ class SDS1104X(ScopeSCPI):
In short decimate=True is slower but more precise.
"""
- trRaw, availableNpnts, Npnts = self.getRawWaveform(
+ trRaw, rawChanCfg = self.getRawWaveform(
chNum,
availableNpnts=availableNpnts,
maxRequiredPoints=maxRequiredPoints,
@@ -281,18 +289,12 @@ class SDS1104X(ScopeSCPI):
tr.config["unit"] = "Volt"
tr.config["tags"]["VoltageOffset"] = VoltageOffset
tr.config["tags"]["VoltsPerDiv"] = VoltsPerDiv
- return (tr, availableNpnts)
+ return (tr, rawChanCfg)
- def getTimeTrace(self, availableNpnts=None, maxRequiredPoints=None):
- if availableNpnts is None:
- # using channel 1 to get availableNpnts
- availableNpnts = self.getAvailableNumberOfPoints(1)
- (
- sparsing,
- Npnts,
- availableNpnts,
- maxRequiredPoints,
- ) = calcSparsingAndNumPoints(availableNpnts, maxRequiredPoints)
+ def getTimeTrace(self, rawChanCfg):
+ availableNpnts = rawChanCfg["availableNpnts"]
+ sparsing = rawChanCfg["sparsing"]
+ Npnts = rawChanCfg["Npnts"]
sampleRate = self.getSampleRate()
timePerDiv = self.getTimePerDiv()
trigDelay = self.getTrigDelay()
@@ -328,15 +330,13 @@ class SDS1104X(ScopeSCPI):
old_trg_mode = self.getTriggerMode()
self.setTriggerMode("STOP")
# to get synchronous channels
- wfVoltage, availableNpnts = self.getWaveform(
+ wfVoltage, rawChanCfg = self.getWaveform(
chNum,
availableNpnts=availableNpnts,
maxRequiredPoints=maxRequiredPoints,
decimate=decimate,
)
- t = self.getTimeTrace(
- availableNpnts=availableNpnts, maxRequiredPoints=maxRequiredPoints
- )
+ t = self.getTimeTrace(rawChanCfg)
tr = TraceXY(f"Ch{chNum}")
tr.x = t
tr.y = wfVoltage