[SciPy-User] info scipy.ndimage.filters.maximum_filter

David Pine djpine@gmail....
Thu Jun 24 11:37:07 CDT 2010


Emmanuelle,

Nifty trick with IPython to see the wrapper.  Thanks for the tip.

I found the C code on the web -- on the "SciPy Dev Wiki" -- but I was unable to locate it on my computer.  I use the Enthought distribution for the Mac.

Thanks again.

Dave


On Jun 23, 2010, at 11:17 AM, Emmanuelle Gouillart wrote:

> Hello,
> 
> most of scipy.ndimage routines are written in C and then wrapped in
> Python. This makes code introspection a bit more difficult. For
> scipy.ndimage.filters.maximum_filter, the core of the routine can be
> found in the source file scipy/ndimage/src/ni_filters.c (the path of
> scipy sources depends on your installation), inside the
> NI_MinOrMaxFilter1D function (I don't know if you're familiar with C).
> 
> If you're using the Ipython shell, a useful trick is to type '%edit
> function_name" to open the source code in a text editor, for example
>>>> from scipy import ndimage
>>>> %edit ndimage.maximum_filter
> Editing... done. Executing edited code...
> 
> will open the the Python file with the wrapper. Of course, this feature
> is more useful when functions are written only with Python. 
> 
> I don't know if this partly answers your question or not...
> 
> Cheers,
> 
> Emmanuelle
> 
> On Wed, Jun 23, 2010 at 10:54:05AM +0200, David Pine wrote:
>> I did but I tried again and found something called "SciPy Dev Wiki" (http://projects.scipy.org/scipy/browser/trunk/scipy/ndimage/filters.py?rev=6405) which contains the original Python code.  I can figure things out from that.  It seems odd to me that the there seems to be no link to the source code for these routines on the SciPy documentation site.
> 
>> -David Pine
> 
>> On Jun 23, 2010, at 10:22 AM, Sebastian Haase wrote:
> 
>>> did you try to google for it ?
>>> - Sebastian Haase
> 
> 
>>> On Fri, Jun 18, 2010 at 5:08 PM, David Pine <dp82@nyu.edu> wrote:
>>>> How do I get more detailed information about scipy.ndimage.filters.maximum_filter than is available at the Numpy and Scipy Documentation Reference Guide?  The guide tells you what the routine does but not how it does it.
>>>> _______________________________________________
>>>> SciPy-User mailing list
>>>> SciPy-User@scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
>>> _______________________________________________
>>> SciPy-User mailing list
>>> SciPy-User@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-User mailing list