Rossiter McLaughlin effect#

In this notebook we demonstrate how to model the Rossiter-McLaughin effect (and radial velocity measurements in general) using jaxoplanet.

Surface radial velocity#

Let’s first define a rotating stellar surface

from jaxoplanet.starry import Surface, show_surface

surface = Surface(period=0.5, obl=0.2, inc=1.1, u=(0.5, 0.2))

To visualize the radial velocity of this surface

import matplotlib.pyplot as plt

im = show_surface(surface, rv=True, return_im=True)
_ = plt.colorbar(im)
../../_images/3b37820bdbe16d27eac4ccb05bdd3e5bbf2e93346c712d9acb72f70af202bf1d.png

We can then plot the rv signal received from this star as it is transited by an exoplanet

import jax
import numpy as np
from jaxoplanet.starry.doppler import surface_radial_velocity

x = np.linspace(-1.2, 1.2, 1000)
rv = jax.vmap(lambda x: surface_radial_velocity(surface, x=x, z=10, r=0.1))(x)

plt.plot(x, rv)
plt.xlabel("planet x coordinate")
plt.ylabel("radial velocity ($R_\odot$ / day)")
_ = plt.tight_layout()
../../_images/f3d4f62ba8bb88ed81e2a63c90d051b070d9efccb4f8cf8aa5c1b72b6ea81c92.png

System radial velocity#

Let’s define a system and compute the integrated radial velocity of its bodies

Important

As jaxoplanet only features two-body keplerian orbits, the full dynamic of a multi-planetary system cannot be accounted for. Hence, this application is limited to systems made of two bodies.

from jaxoplanet.starry.orbit import Body, Central, SurfaceSystem

system = SurfaceSystem(Central(), surface).add_body(
    Body(period=20.0, radius=0.1, mass=0.1)
)

Then, we use the radial_velocity function to compute the radial velocity of the system

import numpy as np
from jaxoplanet.starry.doppler import radial_velocity

time = np.linspace(-0.3, 0.3, 500)
rv = radial_velocity(system)(time).sum(1)

plt.plot(time, rv)
plt.xlabel("time (days)")
plt.ylabel("radial velocity ($R_\odot$ / day)")
_ = plt.tight_layout()
../../_images/3ef91c3e76cf187dce97be9e4b2d17a80062a897f514f7de5a88e666efc25e58.png

Accounting for surface features#

We can also account for surfaces with features like spots. Let’s create such a surface and compute it’s radial velocity.

from jaxoplanet.starry.ylm import ylm_spot

y = ylm_spot(8)(0.8, 0.5, 0.0, 0.0)
surface = Surface(y=y, period=0.5, u=(0.2, 0.4), obl=0.2)

plt.subplot(121)
show_surface(surface, theta=0.9, cmap="Greys_r")
plt.subplot(122)
show_surface(surface, theta=0.9, rv=True)
_ = plt.tight_layout()
../../_images/621c525a6b33d991e33c78b5124c5e6ed87146a51b0b25dd2af8e8bb8eeef928.png

As before, the radial velocity can be computed with

phase = np.linspace(-np.pi, np.pi, 1000)
rv = jax.vmap(lambda phase: surface_radial_velocity(surface, theta=phase))(phase)

plt.plot(phase, rv)
plt.xlabel("phase (rad)")
plt.ylabel("radial velocity ($R_\odot$ / day)")
_ = plt.tight_layout()
../../_images/e84aa5bb4b341b93a0292548313952fa2248e923bb6e172d351432c5e1ba8635.png