Merging Traces

From Elsys Wiki - Help and Recources for TranAX and TraNET DAQ
Revision as of 09:25, 13 November 2017 by Mmeier (talk | contribs)
Jump to: navigation, search

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. This gives you better performance.
SetEnvironment(1, False)

; Don't save files. This gives you better performance.
SetEnvironment(5, True)

filepath = "mergedTrace.tpc5"
trace0 = File("T1_1428_USS002_16kHz_anschleifen.tpc5", 0)
tstart = TBegin(trace0 )
tstop = TEnd(trace0 )

; We choose here a constant width to slice the event
sliceLength[s] = 170e-6

for each timeVal in EnEvents(trace0 , 0, tstart, tstop, 1, 0.25) 
    slicedTrace0 = Slice(trace0, timeVal, timeVal + sliceLength)
    MergeTraces(filepath, "SeparatedEvents", 0, slicedTrace0)
next

CloseFile(filepath)

File:MergedTraces WithoutDelays.jpg