Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Is there a easy/fast way to interpolate all data in a stream?
I would like, given a startDate and endDate and a step, a stream with timestamps every step, and values the interpolation of the original data.
My stream:
timestap | value |
---|---|
2017-10-27 15:13:25.123 | 557 |
2017-10-27 17:19:11.024 | 678 |
2017-10-27 20:02:34.987 | 558 |
2017-10-27 23:45:13.356 | 547 |
2017-10-28 02:12:56.223 | 447 |
2017-10-28 03:27:16.133 | 469 |
I would like this result:
timestap | value |
---|---|
2017-10-27 16:00 | 576,53 |
2017-10-27 18:00 | 626,85 |
2017-10-27 20:00 | 679.08 |
2017-10-27 22:00 | 614.50 |
2017-10-28 00:00 | 664.63 |
2017-10-28 02:00 | 655.65 |
where values come from the interpolation formula
v* = v_0 +[(v_1 - v_0 ) / (t_1 - t_0)]*(t* - t_0)
I tried the service "Interpolate" but doesn't seem to work.
Thank you
This is how I used Interpolate function
(start and end are given as input)
var propertyColumn = "Strain_Measure_Current";
var queryOnStream = {"filters":{"type":"LIKE","fieldName":propertyColumn,"
var streamFiltered = me.QueryStreamEntriesWithData({oldestFirst: true, query: queryOnStream});
var params = {
mode: 'ROWCOUNT',
timeColumn: 'timestamp',
t: streamFiltered,
stats: 'SMOOTH',
endDate: end,
columns: propertyColumn,
count: 50,
startDate: start
};
result = Resources["InfoTableFunctions"].Interpolate(params);
I get this error
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double - 17