Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect light travel time correction for circular orbits #123

Open
JeffValenti opened this issue Jan 11, 2025 · 1 comment
Open

Incorrect light travel time correction for circular orbits #123

JeffValenti opened this issue Jan 11, 2025 · 1 comment

Comments

@JeffValenti
Copy link

For an eccentric orbit, juliet calculates a light travel time (LTT) delay of +51 seconds for eclipses of WASP-17b and HAT-P-26b, as expected (2aRs/c). For a circular orbit, juliet calculates an LTT delay of minus 10 seconds for HAT-P-26b and minus 30 seconds for WASP-17b, which is unphysical and inconsistent with the eccentric case.

In utils.correct_light_travel_time, the code path for a circular orbit has an np.sin(params.inc), which assumes inclination is in radians:

    if params.ecc > 0:
        # Need to solve Kepler's equation, so use the KeplerOrbit class
        # for rapid computation. In the SPIDERMAN notation z is the radial
        # coordinate, while for Bell_EBM the radial coordinate is x
        orbit = KeplerOrbit(a=a, Porb=params.per, inc=params.inc,
                            t0=params.t0, e=params.ecc, argp=params.w)
        old_x, _, _ = orbit.xyz(times)
        transit_x, _, _ = orbit.xyz(params.t0)
    else:
        # No need to solve Kepler's equation for circular orbits, so save
        # some computation time
        transit_x = a*np.sin(params.inc)
        old_x = transit_x*np.cos(2*np.pi*(times-params.t0)/params.per)

But params.inc is in degrees. KeplerOrbit and batman assume inclination is in degrees and multiply by np.pi/180 before use in trigonometric functions. Mistakenly feeding degrees rather than radians to the cos function multiplies the LTT delay by a factor between -1 and 1. Changing the circular orbit code to np.sin(params.inc*np.pi/180) yields an LTT delay of +51 seconds, consistent with expectations and the eccentric orbit case.

Eureka! currently has the same bug: Issue #735

@JeffValenti
Copy link
Author

Submitted pull request #124 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant