legendre

  • Computes associated Legendre functions of degree l evaluated for elements x

  • l must be a scalar integer and x must contain real values ranging -1 <= x <= 1

  • Unnormalized associated Legendre function values will overflow for l > 150

Calling Sequence

from spatial_interpolators.legendre import legendre
Pl = legendre(l, x)

Source code

spatial_interpolators.legendre(l, x, NORMALIZE=False)[source]

Computes associated Legendre functions of degree l following [Abramowitz1965] and [Jacobs1987]

Parameters
l: int

degree of Legrendre polynomials

x: float

elements ranging from -1 to 1

Typically cos(theta), where theta is the colatitude in radians

NORMALIZE: bool, default False

Fully-normalize the Legendre Functions

Returns
Pl: legendre polynomials of degree l

References

Abramowitz1965

M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions, 1046 pp., (1965).

Jacobs1987

J. A. Jacobs, Geomagnetism, Volume 1, 1st Edition, 832 pp., (1987).