jaxoplanet.starry.ylm#

A module to manipulate vectors in the spherical harmonic basis.

The spherical harmonics basis is a set of orthogonal functions defined on the unit sphere. In jaxoplanet, this basis is used to represent the intensity at the surface of a spherical body, such as a star or a planet. We say that \(y\) represents the intensity of a surface in the spherical harmonics basis if the specific intensity at the \((x,y)\) on the surface can be written as:

\[I(x, y) = \mathbf{\tilde{y}_n^\mathsf{T}} (x, y) \, \mathbf{y} \quad,\]

where \(\tilde{y}_n\) is the spherical harmonic basis, arranged in increasing degree and order:

\[\mathbf{\tilde{y}_n} = \begin{pmatrix} Y_{0, 0} & Y_{1, -1} & Y_{1, 0} & Y_{1, 1} & Y_{2, -2} & Y_{2, -1} & Y_{2, 0} & Y_{2, 1} & Y_{2, 2} & \cdot\cdot\cdot \end{pmatrix}^\mathsf{T} \quad,\]

where \(Y_{l, m} = Y_{l, m}(x, y)\) is the spherical harmonic of degree \(l\) and order \(m\). For reference, in this basis the coefficient of the spherical harmonic \(Y_{l, m}\) is located at the index

\[n = l^2 + l + m\]

Classes#

Ylm

Ylm object containing the spherical harmonic coefficients.

Functions#

Bp(ydeg[, npts, eps, smoothing])

Return the matrix B+. This expands the

spot_profile(theta, radius[, spot_fac])

The sigmoid spot profile.

ylm_spot(→ callable)

spot expansion in the spherical harmonics basis.

ring_y(l_max[, pts, eps, smoothing])

Module Contents#

class jaxoplanet.starry.ylm.Ylm(data: collections.abc.Mapping[tuple[int, int], jaxoplanet.types.Array] | None = None)[source]#

Bases: equinox.Module

Ylm object containing the spherical harmonic coefficients.

Parameters:

data (Mapping[tuple[int, int], Array], optional) – dictionary of spherical harmonic coefficients. Defaults to {(0, 0): 1.0}.

data: dict[tuple[int, int], jaxoplanet.types.Array][source]#

coefficients of the spherical harmonic expansion of the map in the form {(l, m): coefficient}

deg: int[source]#

The maximum degree of the spherical harmonic coefficients.

diagonal: bool[source]#

Whether are orders m of the spherical harmonic coefficients are zero. Diagonal if only the degrees “l” are non-zero.

property shape: tuple[int, Ellipsis][source]#

The number of coefficients in the basis. This sets the shape of the output of todense.

property indices: list[tuple[int, int]][source]#

List of (l,m) indices of the spherical harmonic coefficients.

static index(l: jaxoplanet.types.Array, m: jaxoplanet.types.Array) jaxoplanet.types.Array[source]#

Convert the degree and order of the spherical harmonic to the corresponding index in the coefficient array.

normalize() Ylm[source]#

Return a new Ylm instance with coefficients normalized to \(Y_{0,0}\).

Returns:

Ylm instance with normalized coefficients.

Raises:

ValueError – if the (0, 0) coefficient is zero.

tosparse() jax.experimental.sparse.BCOO[source]#

Return a sparse (jax.experimental.sparse.BCOO) spherical harmonic coefficients vector where the spherical harmonic \(Y_{l, m}\) is located at the index \(n = l^2 + l + m\).

todense() jaxoplanet.types.Array[source]#

Return a dense spherical harmonic coefficients vector where the spherical harmonic \(Y_{l, m}\) is located at the index \(n = l^2 + l + m\).

classmethod from_dense(y: jaxoplanet.types.Array, normalize: bool = True) Ylm[source]#

Create a Ylm object from a dense array of spherical harmonic coefficients where the spherical harmonic \(Y_{l, m}\) is located at the index \(n = l^2 + l + m\).

__mul__(other: Any) Ylm[source]#
__rmul__(other: Any) Ylm[source]#
__getitem__(key) jaxoplanet.types.Array[source]#
classmethod from_limb_darkening(u: jaxoplanet.types.Array) Ylm[source]#

Spherical harmonics coefficients from limb darkening coefficients.

jaxoplanet.starry.ylm.Bp(ydeg, npts: int = 1000, eps: float = 1e-09, smoothing=None)[source]#

Return the matrix B+. This expands the spot profile b in Legendre polynomials. From rodluger/ mapping_stellar_surfaces/blob/paper2-arxiv/paper2/figures/spot_profile.py and _spot_setup in starry/_core/core.py.

jaxoplanet.starry.ylm.spot_profile(theta, radius, spot_fac=300)[source]#

The sigmoid spot profile.

jaxoplanet.starry.ylm.ylm_spot(ydeg: int, npts=300, spot_fac=300) callable[source]#

spot expansion in the spherical harmonics basis.

Parameters:

ydeg (int) – max degree of the spherical harmonics

Returns:

function that returns the spherical harmonics coefficients of the spot

Return type:

callable

jaxoplanet.starry.ylm.ring_y(l_max, pts=1000, eps=1e-09, smoothing=None)[source]#