[SciPy-dev] Help for 5-min frequency for timeseries module

Matt Knox mattknox_ca@hotmail....
Mon May 21 08:17:46 CDT 2007


> We are utilizing the timeseries to process mostly hydrological
> datasets, meaning precipitation and discarge data mostly. Now I would
> like to tackle the issue to homogenize frequencies, that we are
> working by using the timeseries library. Some observation devices have
> a base frequency of 5-min, others adjustable ones depending on the
> required resolution. Generally spoken though it is required to have
> user-definable base frequencies (e.g. 1/5-min) for timeseries that may
> be converted into others (e.g. 5/15-min etc.).
> 
> In Matt's and Pierres's posting for the alpha release of the
> timeseries library it is mentioned that additional frequencies may be
> added fairly easily. Could somebody be so kind and point me in the
> right direction on how to do that?

well... "fairly easily" was perhaps a bit of an excaggeration :) . Frequencies 
are defined in the C code, and it is not too difficult to hard code new 
frequencies in C (ie. explicitly define all the frequency conversion 
algorithms for the new frequency), but there is no mechanism currently for a 
user to creatw a new frequency as a multiple of a base frequency. This is 
something I have contemplated a bit, but have not got around to implementing. 
It will be a decent amount of work to add this feature, but it definitely is 
worth having. Unfortunately, I will not likely be able to work on it anytime 
soon (but would happily accept a patch if a motivated individual felt like 
implementing it :) ).

So anyway... if you wanted to hard code those frequencies in C in your copy of 
the code, you could certainly do that, but it would likely prove a frustrating 
experience if you aren't familiar with C. But the answer at the moment 
unfortunately is that it can't be done without modifying the code.

- Matt




More information about the Scipy-dev mailing list