[SciPy-user] time series analysis

Timmie timmichelsen@gmx-topmail...
Tue Nov 6 13:36:25 CST 2007


Matt Knox <mattknox_ca <at> hotmail.com> writes:

> 
> > Some things I can imagine are the following:
> > create a tools directory under the timeseries tree.
> 
> There is a "lib" sub-directory for stuff that falls outside the core 
> Date/TimeSeries classes. It currently includes a sub-module for "moving 
> functions" (moving average, etc...), and interpolation.
> 
> > * common frequency conversions: reduce to hourly values
> 
> Frequency conversions are simple to do using the "convert" method of the 
> TimeSeries class. Here is an example converting an hourly frequency series to 
> daily...
> 
> >>> import numpy as np
> >>> import maskedarray as ma
> >>> import timeseries as ts
> >>> h = ts.time_series(np.arange(50, dtype=np.float32), start_date=ts.today
> ('hourly'))
> >>> h
> timeseries([  0.   1.   2.   3.   4.   5.   6.   7.   8.   9.  10.  11.  12.  
> 13.  14.
>   15.  16.  17.  18.  19.  20.  21.  22.  23.  24.  25.  26.  27.  28.  29.
>   30.  31.  32.  33.  34.  35.  36.  37.  38.  39.  40.  41.  42.  43.  44.
>   45.  46.  47.  48.  49.],
>            dates = [06-Nov-2007 06:00 ... 08-Nov-2007 07:00],
>            freq  = H)
> 
> >>> d = h.convert('daily')
> >>> d
> timeseries(
>  [[-- -- -- -- -- -- 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0
>   13.0 14.0 15.0 16.0 17.0]
>  [18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0
>   32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0]
>  [42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 -- -- -- -- -- -- -- -- -- -- --
>   -- -- -- -- --]],
>            dates =
>  [06-Nov-2007 ... 08-Nov-2007],
>            freq  = D)
> 
> >>> d_avg = h.convert('daily', ma.average)
> >>> d_avg
> timeseries([  8.5  29.5  45.5],
>            dates = [06-Nov-2007 ... 08-Nov-2007],
>            freq  = D)
> 
> ===============================================
> If any of the above seems mysterious, let me know and I can offer a more 
> detailed explanation.
> 
> > * error checking of measurement data: statistically and logically
> 
> Some data error checking algorithms could be useful, yes. I won't likely be 
> working on them in the near future though.
I think that I will have a closer look at the package and then see how I can 
use it. Maybe I can contribute something or at least give you feedback.

Well, I am very happy that I found this package. I really uses some Google 
search but nothing helpful had turned out.

What I also fould (I think via the moin wiki at www.python.org):
* It is a Python package designed to accomplish some usual tasks during the 
analysis of climate variability using Python: http://www.pyclimate.org/
* CDAT makes use of an open-source, object-oriented, easy-to-learn scripting 
language (Python) to link together separate software subsystems and packages to 
form an integrated environment for data analysis. http://www-
pcmdi.llnl.gov/software-portal/cdat

These two packages seem to do quite similar tasks. Or at least head in the same 
direction. But they are depending mainly on the use of netCDF file storage. But 
maybe there could be some likeage?

Kind regards and thanks for your help,
Timmie

P.S.: You my also send me PM on this, too.



More information about the SciPy-user mailing list