exoplanet-dev / jaxoplanet

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

feat: `None` values for angles + optimized P integrals #225

Closed lgrcia closed 1 month ago

lgrcia commented 1 month ago

None values for angle

This PR enables None values for the inclination and obliquity of a surface, enabling loads of optimizations when preforming its rotation.

Improved P integrals

I noticed that the starry P integrals for which $\mu/2$ is even require a very low order integration (Gauss-Legendre) to reach machine-precision. These often account for something like 30% of all the integrals we have to compute for large degrees of the SH basis.

I also noticed that all integrands in the P integrals are symmetrical functions of $\phi$ so that a more precise solution can be obtained at lower order.

All of that makes the computation of the integrals faster (of about ~30%) and improve the overall precision (at least an order of magnitude for a given order).

lgrcia commented 1 month ago

By mistake, this contains the code from #212 and #217 ...