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 gravity_toolkit.legendre import legendre
Pl = legendre(l, x)

Source code

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

Computes associated Legendre functions for a particular degree following Abramowitz and Stegun [2], Jacobs [32]

Parameters:
l: int

degree of Legendre polynomials

x: np.ndarray

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: np.ndarray

legendre polynomials of degree l