# chaosmagpy.model_utils.legendre_poly¶

chaosmagpy.model_utils.legendre_poly(nmax, theta)[source]

Returns associated Legendre polynomials $$P_n^m(\cos\theta)$$ (Schmidt quasi-normalized) and the derivative $$dP_n^m(\cos\theta)/d\theta$$ evaluated at $$\theta$$.

Parameters:
nmaxint, positive

Maximum degree of the spherical expansion.

thetandarray, shape (…)

Colatitude in degrees $$[0^\circ, 180^\circ]$$ of arbitrary shape.

Returns:
Pnmndarray, shape (n, m, …)

Evaluated values and derivatives, grid shape is appended as trailing dimensions. $$P_n^m(\cos\theta)$$ := Pnm[n, m, ...] and $$dP_n^m(\cos\theta)/d\theta$$ := Pnm[m, n+1, ...]

References

Based on Equations 26-29 and Table 2 in:

Langel, R. A., “Geomagnetism - The main field”, Academic Press, 1987, chapter 4