Difference between revisions of "Merging Traces"
From Elsys Wiki - Help and Recources for TranAX and TraNET DAQ
Line 35: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | === Graphical result in TranAX YT Waveform === | ||
[[File:MergedTraces WithoutDelays.png]] | [[File:MergedTraces WithoutDelays.png]] |
Revision as of 09:33, 13 November 2017
With the function MergeTraces you can merge multiple waveforms into one waveform. This can be useful if you want to separate specific events from your measured curve. You are also able to pick single events from a Multiblock measurement and put specific blocks into a new waveform.
Merge events from Continuous Measurement into another trace
If you have a continuous measurement which is fairly long and just have several events which are interesting then you can merge those events into a new trace (tpc5). The function MergeTraces will help you with this task.
; Don't close files
SetEnvironment(1, False)
; Don't save files
SetEnvironment(5, True)
filepath = "mergedTrace.tpc5"
trace0 = File("T1_1428_USS002_16kHz_anschleifen.tpc5", 0)
trace1 = File("T1_1428_USS002_16kHz_anschleifen.tpc5", 1)
trace2 = File("T1_1428_USS002_16kHz_anschleifen.tpc5", 2)
tstart = TBegin(trace2)
tstop = TEnd(trace2)
sliceLength[s] = 170e-6
countEvents = 0
for each timeVal in EnEvents(trace2, 0, tstart, tstop, 1, 0.25)
slicedTrace0 = Slice(trace0, timeVal, timeVal + sliceLength)
slicedTrace1 = Slice(trace1, timeVal, timeVal + sliceLength)
slicedTrace2 = Slice(trace2, timeVal, timeVal + sliceLength)
MergeTraces(filepath, "Körperschall (0.A1)", 0, slicedTrace0)
MergeTraces(filepath, "Körperschall Verst. (0.A2)", 1, slicedTrace1)
MergeTraces(filepath, "Sync (0.A3)", 2, slicedTrace2)
countEvents = countEvents + 1
next
CloseFile(filepath)