diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-21 01:18:14 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-21 01:18:14 -0500 |
commit | 6188068541c86bd5606b23f4310ad05a70317528 (patch) | |
tree | b018b38d197f9e11f54585c5c9ff081a8fe99067 | |
parent | d65fc7d331ff505bcb948e272002fd54ce736e56 (diff) | |
download | qolab-6188068541c86bd5606b23f4310ad05a70317528.tar.gz qolab-6188068541c86bd5606b23f4310ad05a70317528.zip |
added load of TraceXY
-rw-r--r-- | qolab/data/trace.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/qolab/data/trace.py b/qolab/data/trace.py index 0a16ab2..4a96691 100644 --- a/qolab/data/trace.py +++ b/qolab/data/trace.py @@ -35,6 +35,9 @@ def loadTraceRawHeaderAndData(fname): def loadTrace(fname): (header, data) = loadTraceRawHeaderAndData(fname) + return traceFromHeaderAndData(header, data) + +def traceFromHeaderAndData(header, data=None): label = None model = None tr = None @@ -53,10 +56,20 @@ def loadTrace(fname): tr = Trace(label) if data is not None: tr.values = data - elif 'model' == 'TraceXY': + elif model == 'TraceXY': + tx = traceFromHeaderAndData(header['TraceX']) + ty = traceFromHeaderAndData(header['TraceY']) + if data is not None: + tx.values=data[:,0] + ty.values=data[:,1] tr = TraceXY(label) - elif 'model' == 'TraceSetSameX': + tr.x = tx + tr.y = ty + elif model == 'TraceSetSameX': tr = TraceSetSameX(label) + else: + print(f'Error: unknown trace model: {model}') + return None tr.config = header['config'] return tr |