01-27-2022 10:59 AM
Afternoon,
I'm trying to integrate some data but rather than integrate a whole channel of data as the Integrate function appears to do is it possible to specify a start and end reference within the channel so it just integrates a certain section of the data?
This will form part of a larger script so I'm happy for it to be a script solution if that helps.
Thanks
Solved! Go to Solution.
01-27-2022 12:21 PM
I think you cannot directly do it, but I was thinking of a 2-step process that could do the job.
Basically:
Imagine you want to integrate the Example/Speed channel from T=5 to T=30.
You can create a channel Speed_W with ChnEventCreateFilteredTrueChn function, then integrate it.
Below the code. Hope it will help.
ChnEventResultList = ChnEventFind("(A>5) and (A<30)", Array("A"), Array(Data.GetChannel("Example/Time")))
Call ChnEventCreateFilteredTrueChn("Example/Speed_W", ChnEventResultList, "Example/Speed", 0)
Set ChnResult = ChnIntegrate("Example/Time", "Example/Speed_W", "Example/Speed_W_Int", "TrapezoidalRule", 0, False, 0)
02-01-2022 04:56 AM
Thanks! This approach worked nicely.