Making Model Transits¶
When making simulated datasets, the .inject_transit
action can use two different functions for making transits. We make those functions directly available, in case you want to use them for your own wonderful purposes. The options are:
exoplanet_transit
= limb-darkened transits generated withexoplanet_core
trapezoidal_transit
= a very simple non-limb-darkened trapezoidal transit as in Winn (2010)
You should probably use exoplanet_transit
, unless you have a good reason to want to use a cartoon trapezoid instead.
In [1]:
Copied!
from chromatic import exoplanet_transit, trapezoidal_transit
import numpy as np, matplotlib.pyplot as plt
from chromatic import exoplanet_transit, trapezoidal_transit
import numpy as np, matplotlib.pyplot as plt
The first argument to each of these model function is the array of times for which the flux should be computed, and the remaining keyword arguments allow you to change the planet parameters.
In [2]:
Copied!
t = np.linspace(-0.1, 0.1, 1000)
plt.figure(figsize=(8, 3))
for rp, c in zip([0.09, 0.1, 0.11], ["orange", "red", "purple"]):
limb_darkened_model = exoplanet_transit(t, rp=rp)
plt.plot(t, limb_darkened_model, color=c, label=f"$R_p$ = {rp:.2f}")
trapezoid_model = trapezoidal_transit(t, delta=rp**2)
plt.plot(t, trapezoid_model, color=c, linestyle="--", label=f"$R_p$ = {rp:.2f}")
plt.xlabel("Time (days)")
plt.ylabel("Relative Flux")
plt.legend(frameon=False);
t = np.linspace(-0.1, 0.1, 1000)
plt.figure(figsize=(8, 3))
for rp, c in zip([0.09, 0.1, 0.11], ["orange", "red", "purple"]):
limb_darkened_model = exoplanet_transit(t, rp=rp)
plt.plot(t, limb_darkened_model, color=c, label=f"$R_p$ = {rp:.2f}")
trapezoid_model = trapezoidal_transit(t, delta=rp**2)
plt.plot(t, trapezoid_model, color=c, linestyle="--", label=f"$R_p$ = {rp:.2f}")
plt.xlabel("Time (days)")
plt.ylabel("Relative Flux")
plt.legend(frameon=False);
These two functions take different keywords, as explained in their docstrings.
In [3]:
Copied!
exoplanet_transit?
exoplanet_transit?
In [4]:
Copied!
trapezoidal_transit?
trapezoidal_transit?
Have fun!