diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-21 00:26:54 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-07-21 00:29:02 -0400 |
commit | 5b15dc47afad4d45fba7a0b23a3fdf7a8b27a74f (patch) | |
tree | 8f488cf716d3f090def144a9c26030f51e293b3e /qolab/hardware/scope | |
parent | 1351d8d1c4eafd35f123bbd4e964cbe0072b5b33 (diff) | |
download | qolab-5b15dc47afad4d45fba7a0b23a3fdf7a8b27a74f.tar.gz qolab-5b15dc47afad4d45fba7a0b23a3fdf7a8b27a74f.zip |
added time variable to trace
Diffstat (limited to 'qolab/hardware/scope')
-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 |