vba
vba

Reputation: 21

c# library for data aggregation?

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

Answers (3)

Marino Šimić
Marino Šimić

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

Cos Callis
Cos Callis

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

DarkSquirrel42
DarkSquirrel42

Reputation: 10257

maybe you want to have a look at this:

http://esper.codehaus.org/

Upvotes: 1

Related Questions