Discontinuous behavior at large b when specifying both b and duration
See original GitHub issueWhen using xo.orbits.KeplerianOrbit
and specifying both duration and impact parameter b, and then generating a limb-darkened light curve with xo.LimbDarkLightCurve
, some combinations of parameters give eclipses as expected, but at a slightly different impact parameter will switch over to return a flat light curve without any warnings or exceptions.
To Reproduce This sample code illustrates the issue:
import exoplanet as xo
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
rp_over_rstar = 1
u = (0.5, 0.2)
t = np.linspace(0.25, 0.75, 100)
for b in (0.93, 0.94, 0.95, 0.96, 0.97, 0.98):
orbit1 = xo.orbits.KeplerianOrbit(period=1,
t0=0.5,
b=b,
duration=0.05,
)
light_curve = xo.LimbDarkLightCurve(u).get_light_curve(
orbit=orbit1,
r=rp_over_rstar,
t=t
).eval()
plt.plot(t, light_curve, label=f"$b={b}$")
plt.xlabel("Time (JD)")
plt.ylabel("Relative flux")
plt.legend()
plt.show()
That generates this plot:
As shown, the curves with b = 0.96 and lower show eclipses, but at b = 0.97 and higher the behavior switches to a flat light curve.
Expected behavior Most likely this comes from over-determining the light curve so that it is no longer possible to meet both the b and duration constraints. If that is the case, some kind of warning or exception should be generated.
Further comments As I look at the plot, it makes me wonder what “duration” signifies in this case, even for the light curves that aren’t flat. The eclipses have very different start to end durations. There is a crossing point of all of the eclipses, and the width there indeed matches the specified duration, but it’s not clear to me how that is defined. Naively it seems that giving both b and duration should always overdetermine the light curve; the implicit M_star combined with the period will set the semimajor axis, and the specified R_planet / R_star, combined with the implicit R_star, will set R_planet. Thus, it would seem that a given impact parameter would uniquely determine the transit duration.
Versions: Python version : 3.8.3 IPython version : 7.16.1
exoplanet : 0.4.3 matplotlib: 3.2.2 theano : 1.0.4 numpy : 1.18.5
Mac OS X 10.15.7
Additional questions
When not specifying the duration while fitting a transit, is it possible to deterministically store the transit duration at each step in the chain?
Is duration defined as first to fourth contact, or in some other way?
Thanks for your attention to this!
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
It’s not a bug - it’s because you need to pass
ror
to the orbit as well:Ah, great, thanks. I can confirm that the example code gives sensible-looking lightcurves with that change.