spotter.kernels#

Gaussian process kernels and covariance utilities for stellar surfaces and fluxes.

This module defines kernels for spatial correlations on the sphere, active latitude modulation, and flux time series, including marginalization over inclination.

Classes#

GreatCircleDistance

Compute the great-circle distance between two 3-vectors.

ActiveLatitude

Kernel describing the correlation between pixel values on a sphere,

FluxKernel

Kernel for the flux time series of a star, marginalizing over inclination.

Functions#

norm_cov_series(mu, cov[, N])

Series approximation to the normalized covariance.

probability_inc(inc)

Probability density for inclination angle. Given spotter's convention,

Module Contents#

class spotter.kernels.GreatCircleDistance[source]#

Bases: tinygp.kernels.stationary.Distance

Compute the great-circle distance between two 3-vectors.

distance(X1, X2)[source]#

Compute the great-circle distance between two unit vectors.

Parameters:
  • X1 (array_like, shape (3,)) – First unit vector.

  • X2 (array_like, shape (3,)) – Second unit vector.

Returns:

d – Great-circle distance in radians.

Return type:

float

class spotter.kernels.ActiveLatitude[source]#

Bases: tinygp.kernels.Kernel

Kernel describing the correlation between pixel values on a sphere, modulated by latitude.

Parameters:
  • kernel (kernels.Kernel) – Base kernel.

  • latitude (float) – Latitude of activity band (radians).

  • sigma (float) – Width of activity band.

  • symetric (bool, optional) – If True, kernel is symmetric about the equator.

kernel: tinygp.kernels.Kernel[source]#
latitude: jax.Array[source]#
sigma: jax.Array[source]#
symetric: bool = True[source]#
amplitude(X)[source]#

Compute the amplitude modulation for a given pixel.

Parameters:

X (array_like, shape (3,)) – Cartesian coordinates of pixel.

Returns:

amp – Amplitude modulation factor.

Return type:

float

evaluate(X1, X2)[source]#

Evaluate the kernel between two pixels.

Parameters:
  • X1 (array_like, shape (3,)) – First pixel coordinates.

  • X2 (array_like, shape (3,)) – Second pixel coordinates.

Returns:

value – Kernel value.

Return type:

float

spotter.kernels.norm_cov_series(mu, cov, N=10)[source]#

Series approximation to the normalized covariance.

This is stolen from starry_process

Parameters:
  • mu (float) – Mean value.

  • cov (ndarray) – Covariance matrix.

  • N (int, optional) – Number of terms in the series.

Returns:

norm_cov – Normalized covariance matrix.

Return type:

ndarray

spotter.kernels.probability_inc(inc)[source]#

Probability density for inclination angle. Given spotter’s convention, this is simply sin(inc)

Parameters:

inc (float or ndarray) – Inclination angle(s) in radians.

Returns:

prob – Probability density.

Return type:

float or ndarray

class spotter.kernels.FluxKernel[source]#

Bases: tinygp.kernels.Kernel

Kernel for the flux time series of a star, marginalizing over inclination.

Parameters:
  • surface_kernel (kernels.Kernel) – Kernel on the stellar surface.

  • star (Star) – Star object.

  • u (array_like, optional) – Limb darkening coefficients.

  • inc (float, optional) – Inclination in radians.

  • order (int, optional) – Number of quadrature points for inclination marginalization.

  • normalize (bool, optional) – Whether to normalize the covariance.

surface_kernel: tinygp.kernels.Kernel[source]#
star: spotter.Star[source]#
u: jax.Array = None[source]#
inc: jax.Array = None[source]#
order: int = 30[source]#
normalize: bool = True[source]#
__post_init__()[source]#

Initialize the kernel by precomputing the surface covariance.

X(time, i)[source]#

Compute the design matrix for given time and inclination.

Parameters:
  • time (float) – Time in days.

  • i (float) – Inclination in radians.

Returns:

X – Design matrix.

Return type:

ndarray

eval(X2, X1, inc)[source]#

Evaluate the kernel for given times and inclination.

Parameters:
  • X2 (float) – Second time.

  • X1 (float) – First time.

  • inc (float) – Inclination in radians.

Returns:

value – Kernel value.

Return type:

float

evaluate(X1, X2)[source]#

Evaluate the kernel, marginalizing over inclination if needed.

Parameters:
  • X1 (float) – First time.

  • X2 (float) – Second time.

Returns:

value – Kernel value.

Return type:

float

__call__(X1, X2=None)[source]#

Call the kernel, optionally normalizing the covariance.

Parameters:
  • X1 (float) – First time.

  • X2 (float, optional) – Second time.

Returns:

value – Kernel value or covariance matrix.

Return type:

float