diff options
Diffstat (limited to 'qolab/hardware')
-rw-r--r-- | qolab/hardware/scope/rigolds1054z.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/qolab/hardware/scope/rigolds1054z.py b/qolab/hardware/scope/rigolds1054z.py index 6b0a918..e4ed65d 100644 --- a/qolab/hardware/scope/rigolds1054z.py +++ b/qolab/hardware/scope/rigolds1054z.py @@ -272,6 +272,26 @@ class RigolDS1054z(ScopeSCPI): trRaw.config["tags"]["Decimate"] = decimate return (trRaw, rawChanCfg) + def getTimeTrace(self, rawChanCfg): + # sampleRate = self.getSampleRate() + timePerDiv = self.getTimePerDiv() + # trigDelay = self.getTrigDelay() + availableNpnts = rawChanCfg['availableNpnts'] + sparsing = rawChanCfg['sparsing'] + Npnts = rawChanCfg['Npnts'] + ind = np.linspace(0, Npnts-1, Npnts) + tval = (ind - rawChanCfg['xreference'] ) * rawChanCfg['xincrement']*sparsing - rawChanCfg['xorigin'] + t = Trace("time") + t.values = tval.reshape(tval.size, 1) + t.config["unit"] = "S" + t.config["tags"]["TimePerDiv"] = timePerDiv + # t.config["tags"]["TrigDelay"] = trigDelay + # t.config["tags"]["SampleRate"] = sampleRate + t.config["tags"]["AvailableNPnts"] = availableNpnts + t.config["tags"]["Npnts"] = Npnts + t.config["tags"]["Sparsing"] = sparsing + return t + def getWaveform( self, chNum, availableNpnts=None, maxRequiredPoints=None, decimate=True ): @@ -302,14 +322,14 @@ class RigolDS1054z(ScopeSCPI): old_trg_status = self.getTriggerStatus() self.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 + rawChanCfg ) tr = TraceXY(f"Ch{chNum}") tr.x = t |