aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/scope
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-03 14:53:00 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-03 14:53:00 -0500
commit8cff383e7eeb015400386c54e8397acfa4a42fbe (patch)
tree36017e29680b1ffaa5cce330618b4bdfdc3691b8 /qolab/hardware/scope
parent8c67614da984778fa10249d9bbf91719a750f1f4 (diff)
downloadqolab-8cff383e7eeb015400386c54e8397acfa4a42fbe.tar.gz
qolab-8cff383e7eeb015400386c54e8397acfa4a42fbe.zip
added attributes for time trace
Diffstat (limited to 'qolab/hardware/scope')
-rw-r--r--qolab/hardware/scope/sds1104x.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/qolab/hardware/scope/sds1104x.py b/qolab/hardware/scope/sds1104x.py
index c7de350..c1ff7b7 100644
--- a/qolab/hardware/scope/sds1104x.py
+++ b/qolab/hardware/scope/sds1104x.py
@@ -141,18 +141,23 @@ class SDS1104X(ScopeSCPI):
if Npnts is None and sparsing is None:
# using channel 1 as reference
Npnts = self.getAvailableNumberOfPoints(1)
- t = np.arange(Npnts) / sampleRate * sparsing;
- t = t - timePerDiv * self.horizDivOnScreen/2 - trigDelay
+ tval = np.arange(Npnts) / sampleRate * sparsing;
+ tval = tval - timePerDiv * self.horizDivOnScreen/2 - trigDelay
+ t = Trace('time')
+ t.values = tval
+ t.unit = 'S'
+ t.label = 'time'
+ t.attributes['timePerDiv'] = timePerDiv
+ t.attributes['trigDelay'] = trigDelay
+ t.attributes['SampleRate'] = sampleRate
+ t.attributes['sparsing'] = sparsing
return(t)
def getTrace(self, chNum, availableNpnts=None, maxRequiredPoints=None):
wfVoltage, availableNpnts = self.getWaveform( chNum, availableNpnts=availableNpnts, maxRequiredPoints=maxRequiredPoints)
t = self.getTimeTrace(availableNpnts=availableNpnts, maxRequiredPoints=maxRequiredPoints)
tr = TraceXY( f'Ch{chNum}' )
- tr.x.label = 'Time'
- tr.x.unit = 'S'
- tr.x.values = t
- tr.y.descr = f'Ch{chNum}'
+ tr.x = t
tr.y = wfVoltage
return( tr )