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

fred fredantispam at free.fr
Wed Aug 2 17:10:37 CDT 2006


Robert Kern a écrit :
> fred wrote:
> 
>>Robert Kern a écrit :
>>
>>
>>>It is a ufunc, so it is created by calling PyUFunc_FromFuncAndData in 
>>>Lib/special/_cephesmodule.c . 
>>
>>Hmm, it's a little too obscure for me :-(
>>
>>Does it mean that the solution proposed by David is the only one ?
>>I don't like it because you have to pass the dimension of x as arg and
>>because of the loop (thanks anyway, David, you showed me an interesting
>>way ;-)
> 
> 
> 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.
Yes, this is the reason I wrote mylpmn for instance, which returns
- only the Legendre function and not its derivative ;
- only for order m and degree n.

> Note that in the f2py interface that David wrote, you won't have to pass in the 
> dimension of x as an argument from Python; you just have to write the underlying 
> FORTRAN subroutine to do so. The f2py interface takes care of inferring the 
> dimensions of your inputs for you.
Ok, I did not really read it completely. Thanks to have pointed me on that.

Cheers,

-- 
Fred.


More information about the SciPy-user mailing list