Implementation details#
Vectorized rotational modulation computation#
Suppose we have \(N\) stars, each with \(M\) starspots, distributed randomly above minimum latitudes \({\bf \ell_{min}}\), observed at \(N\) inclinations \(\vec{i}_\star\) (one unique inclination per star), observed at \(O\) phases throughout a full rotation \(\vec{\phi} \sim \mathcal{U}(0, 90^\circ)\).
We initialize each star such that its rotation axis is aligned with the \(\hat{z}\) axis, and set the observer at \(x \rightarrow \infty\), viewing down the \(\hat{x}\) axis towards the origin.
We define the rotation matrices about the \(\hat{y}\) and \(\hat{z}\) axes for a rotation by angle \(\theta\):
We begin with the matrix of starspot positions in Cartesian coordinates \({\bf C_i}\),
for \(i=1\) to \(N\) with shape \((3, M)\), which we collect into the array \({\bf S}\),
of shape \((3, M, N)\). We rotate the starspot positions through each angle in \(\phi_j\) for \(j=1\) to \(O\) by multiplying \(\bf S\) by the rotation array
with shape \((O, 1, 1, 3, 3)\). Using Einstein notation, we transform the Cartesian coordinates array \(\bf C\) with:
to produce a array with shape \((3, O, M, N)\), where \(lm...\) indicates an optional additional set of dimensions. Then after each star has been rotated about its rotation axis in \(\hat{z}\), we rotate each star about the \(\hat{y}\) axis to represent the stellar inclinations \(i_{\star, k}\) for \(k=1\) to \(N\), using the rotation array
with shape \((N, 3, 3)\), by doing
which produces another array of shape \((3, O, M, N)\). Now we extract the second and third axes of the first dimension, which correspond to the \(y\) and \(z\) (sky-plane) coordinates, and compute the radial position of the starspot \({\bf \rho} = \sqrt{y^2 + z^2}\), where \(\bf \rho\) has shape \((O, M, N)\). We now mask the array so that any spots with \(x < 0\) are masked from further computations, as these spots will not be visible to the observer. We use \(\rho\) to compute the quadratic limb darkening
for \(\mu = \sqrt{1 - \rho^2}\). We compute the flux missing due to starspots of radii \(\bf R_{\rm spot}\), which has shape \((M, N)\):
The unspotted flux of the star is
so the spotted flux is
Limitations of the model#
The model presented above works best for spots that are small. The array masking step for \(x < 0\) does not account for the change in stellar flux due to large starspots which straddle the limb of the star. Large starspots also have differential limb-darkening across their extent, which is not computed by fleck.