07-18-2011 10:58 AM
Hi DIAdem-Freaks,
I'm a DIAdem-Beginner and have a (hopefully) simple question.
There are two channels. One with Timestamps and one with data (Counter of events).
e.g:
Time ; Counter
17.7.2011 12:00; 0
17.7.2011 13:00; 100
17.7.2011 13:30; 150
17.7.2011 14:00; 200
17.7.2011 14:15; 250
17.7.2011 14:45; 350
17.7.2011 15:15; 450
17.7.2011 15:30; 600
etc.
I want to calculate the increase of each hour (or day) in two new channels (time and data).
e.g.:
17.7.2011 13:00; 100
17.7.2011 14:00; 100
17.7.2011 15:00; 200
etc.
The function ChnDifferentiate() make only a differentiation with the same time channel.
It should interpolate missing data (e.g. here 17.7.2011 15:00)
I prefere to work with the Calculation Manager, but any solution may help me.
Thank you.
Best reagards,
Waldi089
07-19-2011 01:24 AM
Hello Waldi089,
You can calculate it with the "Reduced Classification" function of DIAdem ANALYSIS. You need to define a channel with the class limits - in your case a time channel with a hour step width. With that channel you define the classes of the classification function. The other parameters of this function are the channels "Time" and "Counter" as well as reduction mode "Sum". You can calculate it interactively or with a script. Below you find the script example for the attached dataset.
Call ChnGenTime("/TimeGenerated1","hour",6.34781952E+10,6.34782204E+10,1,"StartStepEnd",10) ClassNo = 7 ClassBegin = 6.34781952E+10 ClassEnd = 6.34782204E+10 ClassWidth = 3600 ClassRangeWidth = 25200 ClassChn = "[1]/TimeGenerated1" Call ChnClassXRedXY("[1]/TimeGenerated","[1]/TimeGenerated1","[1]/Channel","Channel","Sum",0,0,0)
Greetings
Walter
07-19-2011 04:31 AM
Hi Walter,
thank you for your reply. The idea was good, but there were some detail-problems, which I solved by myself.
Here my solution:
' Input channel: Time="Time", data="Counter" ' Generate result time line Call ChnGenTime("/TimeDelta","hour",Data.Root.ChannelGroups(1).Channels("Time").Properties("minimum").Value,Data.Root.ChannelGroups(1).Channels("Time").Properties("maximum").Value,1,"StartStepEnd",10) ' Calc aproximated channel Call ChnMapLinCalc("/Time","[1]/Counter","[1]/TimeDelta","/Delta",1,"Y[bound.value]",NOVALUE,"analogue") '... XW,Y,X1,E,MapLinNovInterp,MapLinExtType,MapLinBdryVal,MapLinFctType ' Calc Delta in channels Call ChnDeltaCalc("[1]/Delta","/Delta") '... Y,E ' Result in "TimeDelta" and "Delta"
Best regards,
Waldi089