Additional transit when using high eccentricity
Closed this issue · 3 comments
Dear Hannu,
I've been trying out PyTransit and I got an unexpected behaviour when pushing the eccentricity higher than 0.45: a second transit is appearing in the light curve! See the attached plot:
To Reproduce
These are the rather simple steps to reproduce the behavior:
%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
from pytransit import QuadraticModel
t_plot = np.arange(0.85, 1.05, 0.00001)
tm = QuadraticModel()
tm.set_data(t_plot)
k, t0, p, a, i, e, w = 0.1, 0., 1., 15., 87./180.*np.pi, 0.4, 47./180.*np.pi
ldc = [0.1, 0.3]
flux_pytransit = tm.evaluate_ps(k, ldc, t0, p, a, i, e, w)
e = 0.50
flux_pytransit_02 = tm.evaluate_ps(k, ldc, t0, p, a, i, e, w)
plt.figure(figsize=(5,5))
plt.plot(t_plot, flux_pytransit_02, c='C1', label="e=0.5")
plt.plot(t_plot, flux_pytransit, c='C0', label="e=0.4")
plt.legend()
plt.xlabel('time')
plt.ylabel('flux')
plt.show()
Expected behavior
Only one transit!
Desktop
- OS: WSL Ubuntu 20.04 on Windows 10
- Python: 3.8.5
- Numpy: 1.20.1
- Scipy: 1.5.2
- PyTransit: 2.5.6 (downloaded today)
Thank you for your attention,
Luca
Thanks for spotting this Luca! I had simplified the calculation of the transit bounding box too much... The issue is now fixed (for the QuadraticModel) in the latest commit. I still need to apply the same fix to the rest of the transit models, but this will need to wait until tomorrow.
Hi Hannu,
I tried the QuadraticModel, QPower2Model, and RoadRunnerModel, and they all worked without problems!
Thank you very much for the quick bugfix,
Luca
Great, and thanks again for pointing out the bug!