[SciPy-Dev] scikit-signal or Similar

Stuart Mumford stuart at mumford.me.uk
Mon Feb 6 05:13:24 EST 2012


Hello,


Sorry - I've been off the list for awhile as I was transitioning to my
> first 'real world' job. Now that I'm back - hello! This was my first
> attempt at object oriented programming - I'll need to take a look at the
> code again to see what I was (or was not) thinking at the time :-)
>

Nice to have you around to help and I am glad you now have some time to
help out! For a first attempt at OOP it's very good! (well much better than
my first attempt was!) I was thinking about how would be best to implement
it, we want to try and mirror as closely as possible the calling sequence
of PyWavelets and it's DWT routines. They use the approach of

>>> cA, cD = pywt.dwt(data,mother)
where mother is either a string or an instance of a mother class.

So I was thinking would the best code structure to be have a "Wavelet"
class which is subclassed for cwt, icwt ccwt etc. and a Mother class which
is subclassed for each family like Morlet, DOG etc.

Then into the Wavelet instance you can pass either a subclass of mother or
a string and go from there.

This is pretty close to how your code is structured at the moment, just
need to make the main cwt etc. functions subclasses of Wavelet?

As for results I think it would be best to return a class when cwt etc. is
called and then have attributes such as power, data, coefficients etc.

ie

wave = scipy.signal.wavelet.cwt.cwt(data,'morlet')
pwr = wave.power
wave.scalogram()

etc.


>
> > I shall work on improving that code, I can implement more and more
> general
> > Mother wavelets and also write some examples and update the plotting
> > routine to use mpl's make_axes_locatable if people think that is a better
> > way to go.
> >
>
> I'd be happy to start working on this again. I'm still finishing up my
> PhD, but I am now working as a developer at UCAR / Unidata and have some
> time I can officially spend on 'guerrilla projects' like this
> (especially since it can/will benefit the atmospheric science community)!
>

I am also doing a Solar Physics PhD so this stuff gets used in lots of
places!! I think as a todo list things that need doing are:

* Agree on a calling and code structure and implement.
* Implement other wavelet families and make all general in order m (ie
Mexican hat is just m=2 of DOG)
* Implement a significance contouring routine.
* Develop some tests to show it works!

There will probably be many little things to find on the way along, but I
think they are the major points? One other question, do we want a plotting
routine inside the module or keep it as an example in the documentation? I
ask because I don't know what is the norm.

Stuart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20120206/82562337/attachment.html>


More information about the SciPy-Dev mailing list