[SciPy-user] jn & lpmn or sph_jn...

Nils Wagner nwagner at iam.uni-stuttgart.de
Thu Aug 3 05:37:32 CDT 2006


fred wrote:
> Robert Kern a écrit :
>
> [snip]
>
>   
>> It's probably the easiest one. There is a reason that the current forms of the 
>> spherical harmonic functions are not ufuncs like jn is: they can't be shoved 
>> into the ufunc framework since they return arrays for scalar inputs.
>>     
>
> marsu[pts/0]:~/{5}/> ipython
> Python 2.4.3 (#1, Jul 25 2006, 18:55:45)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.7.2 -- An enhanced Interactive Python.
> ?       -> Introduction to IPython's features.
> %magic  -> Information about IPython's 'magic' % functions.
> help    -> Python's own help system.
> object? -> Details about 'object'. ?object also works, ?? prints more.
>
> In [1]: from scipy.special import *
>
> In [2]: help(lpmn)
> Help on function lpmn in module scipy.special.basic:
>
> lpmn(m, n, z)
>     Associated Legendre functions of the first kind, Pmn(z) and its
>     derivative, Pmn'(z) of order m and degree n.  Returns two
>     arrays of size (m+1,n+1) containing Pmn(z) and Pmn'(z) for
>     all orders from 0..m and degrees from 0..n.
>
>     z can be complex.
>
> In [3]: help(jn)
> Help on ufunc object:
>
> jn = class ufunc(__builtin__.object)
>  |  Optimized functions make it possible to implement arithmetic with
> arrays efficiently
>  |
>  |  Methods defined here:
>  |
>  |  __call__(...)
>  |      x.__call__(...) <==> x(...)
>  |
>  |  __repr__(...)
>  |      x.__repr__() <==> repr(x)
>  |
>  |  __str__(...)
>  |      x.__str__() <==> str(x)
>  |
>  |  accumulate(...)
>  |
>  |  outer(...)
>  |
>  |  reduce(...)
>  |
>  |  reduceat(...)
> .../...
>
> How can I get info about jn functions ??
>
> Cheers,
>
>   


You can try

ipython

Python 2.4.1 (#1, Sep 12 2005, 23:33:18)
Type "copyright", "credits" or "license" for more information.

IPython 0.7.3.svn -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: from scipy import *

In [2]: special.jn?
Type:           ufunc
Base Class:     <type 'numpy.ufunc'>
String Form:    <ufunc 'jn'>
Namespace:      Interactive
Docstring:
    y = jn(x1,x2) y=jn(n,x) returns the Bessel function of integer order
n at  x.

In [3]: info(special.jn)
y = jn(x1,x2) y=jn(n,x) returns the Bessel function of integer order n
at  x.

Nils



More information about the SciPy-user mailing list