Reputation: 21
I have weather data which comes at random intervals, from minutes to hours. I need to process the data.
What library (or approach) can be used to aggregate the data into equidistant intervals, e.g. 15 mins, or 1 hr using algorithm like weighted average (preferably, this should be configurable)?
Also, the data may have gaps longer than the output intervals - what algorithms could be applied to fill the gaps?
Upvotes: 1
Views: 923
Reputation: 7342
You could use quarters since 01.01.0001 to partition data.
int quarters = (int)((eventDate - new DateTime(1, 1, 1)).TotalMinutes / 15);
And the interpolation you look for is probably linear interpolation.
Upvotes: 0
Reputation: 5084
If you are already (or willing to...) persist the data through MS SQL then you can use something like this: T-SQL: Round to nearest 15 minute interval
Upvotes: 0