basis#

Functions#

basis(lmax)

Full change of basis matrix from spherical harmonics to Green's basis

A1(lmax)

Change of basis matrix from spherical harmonics to polynomial basis.

A2_inv(lmax)

Change of basis matrix from polynomial basis to Green's basis.

ptilde(n)

Compute the x, y, and z powers of the n-th polynomial basis term.

Alm(l, m)

Blmjk(l, m, j, k)

Cpqk(p, q, k)

Ylm(l, m)

Compute the coefficients of the spherical harmonic Y_{l,m}.

p_Y(p, l, m, n)

Return a representation of Y_{l, m} in the polynomial basis.

gtilde(n)

Compute the n-th term of the Green basis in the polynomial basis.

p_G(p, l, m, n)

Return a representation of Green's basis n-th term in the polynomial basis.

poly_basis(deg)

utilde(n)

u_p(p, l, m, n)

U(udeg)

Change of basis matrix from limb darkening basis to polynomial basis.

Module Contents#

basis.basis(lmax)[source]#

Full change of basis matrix from spherical harmonics to Green’s basis

Parameters:

lmax (int) – maximum degree of the spherical harmonic basis

basis.A1(lmax)[source]#

Change of basis matrix from spherical harmonics to polynomial basis.

Parameters:

lmax (int) – Maximum degree of the spherical harmonic basis.

Returns:

Description of the return value.

Return type:

TODO

basis.A2_inv(lmax)[source]#

Change of basis matrix from polynomial basis to Green’s basis.

Parameters:

lmax (int) – Maximum degree of the spherical harmonic basis.

Returns:

Description of the return value.

Return type:

TODO

basis.ptilde(n)[source]#

Compute the x, y, and z powers of the n-th polynomial basis term.

If the n-th term is x^i y^j z^k, return (i, j, k).

Parameters:

n (int) – Index of the polynomial basis term.

Returns:

(i, j, k)

Return type:

tuple

Example

>>> ptilde(2) # z
(0, 0, 1)
>>> ptilde(3) # x + y
(1, 1, 0)
basis.Alm(l, m)[source]#
basis.Blmjk(l, m, j, k)[source]#
basis.Cpqk(p, q, k)[source]#
basis.Ylm(l, m)[source]#

Compute the coefficients of the spherical harmonic Y_{l,m}.

Parameters:
  • l (int) – Degree of the spherical harmonic.

  • m (int) – Order of the spherical harmonic in the range [-l, l].

Returns:

{(i, j, k): coeff} where i, j, k are the powers of x, y, z (see ptilde).

Return type:

dict

Example

>>> Ylm(2, 0)
{(0, 0, 0): 0.6307831305050402,
    (2, 0, 0): -0.9461746957575603,
    (0, 2, 0): -0.9461746957575603}
basis.p_Y(p, l, m, n)[source]#

Return a representation of Y_{l, m} in the polynomial basis.

Parameters:
  • p (dict) – Powers of xyz as returned by ptilde.

  • l (int) – Degree of the spherical harmonic.

  • m (int) – Order of the spherical harmonic in the range [-l, l].

  • n (None) – Dummy variable.

Returns:

(indices, data) where indices is an np.array of indices of the polynomial

basis terms and data is an np.array of the coefficients of the polynomial basis terms.

Return type:

tuple

Example

>>> p = {ptilde(m): m for m in range(9)}
>>> p_Y(p, 2, 0, 0)
(array([0, 4, 8]), array([ 0.63078313, -0.9461747 , -0.9461747 ]))
# see correspondence with `Ylm` example
basis.gtilde(n)[source]#

Compute the n-th term of the Green basis in the polynomial basis.

Parameters:

n (int) – Index of the Green basis term.

Returns:

{(i, j, k): coeff} where i, j, k are the powers of x, y, z (see ptilde).

Return type:

dict

Example

>>> gtilde(50)
{(4, 0, 1): 5, (4, 2, 1): -5, (6, 0, 1): -8}
basis.p_G(p, l, m, n)[source]#

Return a representation of Green’s basis n-th term in the polynomial basis.

Parameters:
  • p (dict) – Powers of xyz as returned by ptilde.

  • l (None) – Dummy variable.

  • m (None) – Dummy variable.

  • n (int) – Index of the Green basis term.

Returns:

(indices, data) where indices is an np.array of indices of the polynomial

basis terms and data is an np.array of the coefficients of the polynomial basis terms.

Return type:

tuple

Example

>>> p = {ptilde(n): n for n in range(100)}
>>> p_G(p, None, None, 50)
(array([26, 50, 54]), array([ 5., -8., -5.]))
basis.poly_basis(deg)[source]#
basis.utilde(n)[source]#
basis.u_p(p, l, m, n)[source]#
basis.U(udeg: int)[source]#

Change of basis matrix from limb darkening basis to polynomial basis.

Parameters:

udeg (int) – Degree of the limb darkening basis.

Returns:

TODO