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/c8452175704eb724e07ac217d0ca81e304fff239e9deb7f8b7754020c1005592.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/fec771e6e986931d07f45905b60f2f37d88621fe851883b80074f7255b73f361.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/7e0f89f4e02f86ef31759e8dcd6b7672e40b154da4df5ed1f9f6fb9765208a20.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/a6111dd6d35a270964d32f711d2a003d36b86a8d091ecde88a1065e7630649d7.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/464573f5da78245a9eb4e0eab7b9a6ca096843c345c9f408587bfb34b4a2e820.png