exoplanet-dev / jaxoplanet

Astronomical time series analysis with JAX
https://jax.exoplanet.codes
MIT License
41 stars 12 forks source link

feat: faster rotation decomposition + refactor axis angle functions #182

Closed lgrcia closed 5 months ago

lgrcia commented 5 months ago

Faster rotations of the spherical harmonics. This is described in the technical paper but the idea is to go from 6 rotations

Screenshot 2024-06-14 at 1 57 03 PM

to 4

Screenshot 2024-06-14 at 1 56 42 PM

In the previous implementation I merged all rotations, which ends up not being optimal (because of the rotation around y).

The combined rotation to orient the star in the plane of the sky is defined by the axis

\begin{equation}
    v = \frac{1}{\sqrt{1 - \cos^2{\left(\frac{inc}{2} \right)} \cos^2{\left(\frac{obl}{2}\right)}}} \begin{pmatrix}
        \sin{\left(\frac{inc}{2} \right)} \cos{\left(\frac{obl}{2}\right)}\\
        \sin{\left(\frac{inc}{2} \right)} \sin{\left(\frac{obl}{2}\right)}\\
         - \cos{\left(\frac{inc}{2} \right)} \sin{\left(\frac{obl}{2}\right)}\\
    \end{pmatrix},
\end{equation}

and angle $\omega = 2 \cos^{-1}{\left(\cos{\left(\frac{inc}{2} \right)} \cos{\left(\frac{obl}{2}\right)} \right)}.$