associated_legendre

  • Computes fully-normalized associated Legendre Polynomials and their first derivative for a vector of x values

Calling Sequence

import gravity_toolkit.associated_legendre
PLM, dPLM = gravtk.associated_legendre.polynomials(LMAX, x, method='holmes')

Source code

gravity_toolkit.associated_legendre(LMAX, x, method='holmes', MMAX=None, astype=<class 'numpy.float64'>)[source]

Computes fully-normalized associated Legendre Polynomials and their first derivative

Parameters:
LMAX: int

maximum degree of Legendre polynomials

x: np.ndarray

elements ranging from -1 to 1

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

method: str, default ‘holmes’

Method for computing the associated Legendre polynomials

  • 'columbo'

  • 'holmes'

  • 'mohlenkamp'

MMAX: int or NoneType, default None

maximum order of Associated Legendre polynomials

astype: np.dtype, default np.float64

output variable data type

Returns:
plms: np.ndarray

fully-normalized Legendre polynomials

dplms: np.ndarray

first derivative of Legendre polynomials

gravity_toolkit.plm_colombo(LMAX, x, MMAX=None, astype=<class 'numpy.float64'>)[source]

Computes fully-normalized associated Legendre Polynomials and their first derivative using a Standard forward column method [12]

Parameters:
LMAX: int

maximum degree of Legendre polynomials

x: np.ndarray

elements ranging from -1 to 1

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

MMAX: int or NoneType, default None

maximum order of Associated Legendre polynomials

astype: np.dtype, default np.float64

output variable data type

Returns:
plm: np.ndarray

fully-normalized Legendre polynomials

dplm: np.ndarray

first derivative of Legendre polynomials

gravity_toolkit.plm_holmes(LMAX, x, MMAX=None, astype=<class 'numpy.float64'>)[source]

Computes fully-normalized associated Legendre Polynomials and their first derivative using the recursion relation from [26]

Parameters:
LMAX: int

maximum degree of Legendre polynomials

x: np.ndarray

elements ranging from -1 to 1

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

MMAX: int or NoneType, default None

maximum order of Associated Legendre polynomials

astype: np.dtype, default np.float64

output variable data type

Returns:
plm: np.ndarray

fully-normalized Legendre polynomials

dplm: np.ndarray

first derivative of Legendre polynomials

gravity_toolkit.plm_mohlenkamp(LMAX, x, MMAX=None, astype=<class 'numpy.float64'>)[source]

Computes fully-normalized associated Legendre Polynomials and their first derivative using the recursion relation from [46]

Derived from [65] recurrence formula for Jacobi Polynomials

Parameters:
LMAX: int

maximum degree of Legendre polynomials

x: np.ndarray

elements ranging from -1 to 1

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

MMAX: int or NoneType, default None

maximum order of Associated Legendre polynomials

astype: np.dtype, default np.float64

output variable data type

Returns:
plm: np.ndarray

fully-normalized Legendre polynomials

dplm: np.ndarray

first derivative of Legendre polynomials