[SciPy-Dev] Including Lomb-Scargle code in scipy.signal (sub)module

Pim Schellart P.Schellart at astro.ru.nl
Wed Feb 9 17:48:56 EST 2011


Yes, I see your point, using an acronym probably makes it more complicated for people to find the routines if they are not familiar with the subject.
I guess that having longer module names is a small price to pay for clarity.
I especially like the suggestion of making separate spectral_analysis/curve_fitting/filter_design modules within signal however that is obviously not up to me to decide :)
The suggestion of similarity to the numpy.polynomials module is also quite interesting.
I think the following naming scheme (similar to the one used in scipy.optimize) would be nice:

signal.spectral_analysis.periodogram_classical
signal.spectral_analysis.periodogram_lombscargle
signal.spectral_analysis.periodogram_ribicky
...

perhaps with `signal.spectral_analysis.periodogram` as an alias to the most useful form.
I intend to implement at least these two additional functions as soon as I have time.

Kind regards,

Pim Schellart

On Feb 9, 2011, at 7:00 PM, scipy-dev-request at scipy.org wrote:

> Send SciPy-Dev mailing list submissions to
> 	scipy-dev at scipy.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mail.scipy.org/mailman/listinfo/scipy-dev
> or, via email, send a message with subject or body 'help' to
> 	scipy-dev-request at scipy.org
> 
> You can reach the person managing the list at
> 	scipy-dev-owner at scipy.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of SciPy-Dev digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Including Lomb-Scargle code in	scipy.signal	(sub)module
>      (Bruce Southey)
>   2. Re: Including Lomb-Scargle code in scipy.signal	(sub)module
>      (Charles R Harris)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 09 Feb 2011 09:19:49 -0600
> From: Bruce Southey <bsouthey at gmail.com>
> Subject: Re: [SciPy-Dev] Including Lomb-Scargle code in	scipy.signal
> 	(sub)module
> To: scipy-dev at scipy.org
> Message-ID: <4D52B095.2000408 at gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> On 02/09/2011 08:04 AM, Gael Varoquaux wrote:
>> LSSA is incomprehensible to me. Acronymes are bad for communication,
>> IMHO. I suggest 'spectral'.
>> 
>> Gael
>> 
>> PS: and Aubergine for the bikeshed, of course.
>> 
>> On Wed, Feb 09, 2011 at 03:01:16PM +0100, Pim Schellart wrote:
>>> Dear SciPy developers,
>>> I have recently submitted code to calculate the Lomb-Scargle periodogram (see ticket http://projects.scipy.org/scipy/ticket/1352 for more information).
>>> After some iterations of review, recoding, adding documentation and adding unit tests the code (according to Ralf Gommers) is ready to go in.
>>> Ralf has nicely integrated the code into SciPy trunk in his git branch (https://github.com/rgommers/scipy/tree/lomb-scargle) and you may pull from there.
>>> Now the time has come to discuss where to put it and Ralf has suggested to have this discussion here:
>>> "I've played with your code a bit, changed a few things, and added it to scipy.signal in a github branch:https://github.com/rgommers/scipy/tree/lomb-scargle. I think it looks good, whether it really should go into signal should be discussed on the mailing list (but seemed like the logical place for it).
>>> ...
>>> The best name for the module I could think of was spectral_analysis, maybe there's a better one? It allows to add similar methods later.
>>> "
>>> I would like to suggest the module name "lssa" for "Least-squares spectral analysis". So the full path would be scipy.signal.lssa. This has several advantages.
>>> 1. It is a short name without underscores (personal preference)
>>> 2. It is a category name that can comprise several similar algorithms as desired.
>>> 3. It is immediately obvious from this name that this is different than FFT and therefore people will not be confused looking for FFT functions in this sub-module.
>>> 4. The name corresponds to the Wikipedia entry for this category of algorithms :) (but on a serious note this may help for people that want to find more information, or for people browsing wikipedia that are looking for an implementation).
>>> Please let me know what you think.
>>> Kind regards,
>>> Pim Schellart
>>> _______________________________________________
>>> SciPy-Dev mailing list
>>> SciPy-Dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/scipy-dev
> I do agree with Gael about acronyms and initialisms. If the people know 
> what lssa is in this context, then they should certainly know words like 
> 'Lomb-Scargle', 'periodogram' and signal density! Rather the audience 
> you need are the ones that need help to go from signal density to 
> periodogram to Lomb-Scargle to '[l]east-squares spectral analysis' to 
> lssa. So using lssa is not much of a help to anyone except people who 
> can not enter more than a few letters.
> 
> It is not my area but Wikipedia's entry 
> (http://en.wikipedia.org/wiki/Periodogram) implies that there is more to 
> this particular area than this very specific implementation. So you need 
> to provide a general framework of how every relates to signal processing 
> with an object-orientated view. This allows not only people to use your 
> code but also to contribute in a unified manner. Also I probably 
> incorrectly presume that 'spectral' is rather redundant when talking 
> about signals in this context.
> 
> Given that '[t]he periodogram is an estimate of the spectral density of 
> a signal' (from the Wikipedia periodogram entry) so 
> 'scipy.signal.density' would seem appropriate location.
> 
> Is there another way of doing 'spectral analysis' that does not involve 
> least-squares? If so then you need to allow for these approaches.
> Also, Wikipedia entry 
> (http://en.wikipedia.org/wiki/Least-squares_spectral_analysis) gives 
> multiple methods so technically the design should allow for these if 
> someone wanted to add them in the future. (Of course this entry talks 
> about 'estimating a frequency spectrum' not a density as per the 
> periodogram entry - I do not consider frequency to be always equivalent 
> to a density but could be true here.)
> 
> Anyhow, I am sure you know the differences, so I would suggest that 
> there is either a single general periodogram/density/fit/estimation 
> class/function (that permits different approaches) or set of functions 
> that are similar numpy's polynomials.
> 
> Bruce
> 
> 
> 
> 
> 
> 
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20110209/24055ef2/attachment-0001.html 
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 9 Feb 2011 08:38:01 -0700
> From: Charles R Harris <charlesr.harris at gmail.com>
> Subject: Re: [SciPy-Dev] Including Lomb-Scargle code in scipy.signal
> 	(sub)module
> To: SciPy Developers List <scipy-dev at scipy.org>
> Message-ID:
> 	<AANLkTim+71a2-A91x6k73UDNgjLpq0Ut9zEfnJOZOwZB at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> On Wed, Feb 9, 2011 at 7:01 AM, Pim Schellart <P.Schellart at astro.ru.nl>wrote:
> 
>> Dear SciPy developers,
>> 
>> I have recently submitted code to calculate the Lomb-Scargle periodogram
>> (see ticket http://projects.scipy.org/scipy/ticket/1352 for more
>> information).
>> After some iterations of review, recoding, adding documentation and adding
>> unit tests the code (according to Ralf Gommers) is ready to go in.
>> Ralf has nicely integrated the code into SciPy trunk in his git branch (
>> https://github.com/rgommers/scipy/tree/lomb-scargle) and you may pull from
>> there.
>> Now the time has come to discuss where to put it and Ralf has suggested to
>> have this discussion here:
>> 
>> "I've played with your code a bit, changed a few things, and added it to
>> scipy.signal in a github branch:
>> https://github.com/rgommers/scipy/tree/lomb-scargle. I think it looks
>> good, whether it really should go into signal should be discussed on the
>> mailing list (but seemed like the logical place for it).
>> 
>> ...
>> 
>> The best name for the module I could think of was spectral_analysis, maybe
>> there's a better one? It allows to add similar methods later.
>> "
>> 
>> I would like to suggest the module name "lssa" for "Least-squares spectral
>> analysis". So the full path would be scipy.signal.lssa. This has several
>> advantages.
>> 1. It is a short name without underscores (personal preference)
>> 2. It is a category name that can comprise several similar algorithms as
>> desired.
>> 3. It is immediately obvious from this name that this is different than FFT
>> and therefore people will not be confused looking for FFT functions in this
>> sub-module.
>> 4. The name corresponds to the Wikipedia entry for this category of
>> algorithms :) (but on a serious note this may help for people that want to
>> find more information, or for people browsing wikipedia that are looking for
>> an implementation).
>> 
>> Please let me know what you think.
>> 
>> 
> 
> The signal module is collecting a lot of various stuff. Maybe at some point
> we should have separate spectral_analysis/curve_fitting/filter_design
> modules.
> 
> Chuck
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20110209/334a842d/attachment-0001.html 
> 
> ------------------------------
> 
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
> 
> 
> End of SciPy-Dev Digest, Vol 88, Issue 11
> *****************************************




More information about the SciPy-Dev mailing list