question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discontinuous behavior at large b when specifying both b and duration

See original GitHub issue

When 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:

exoplanet_b_duration

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:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
dfmcommented, Dec 29, 2020

It’s not a bug - it’s because you need to pass ror to the orbit as well:

    orbit1 = xo.orbits.KeplerianOrbit(period=1, 
                                      t0=0.5, 
                                      b=b, 
                                      duration=0.05,
                                      ror=rp_over_rstar
                                     )
1reaction
elnjensencommented, Dec 30, 2020

Ah, great, thanks. I can confirm that the example code gives sensible-looking lightcurves with that change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use of Discontinuous Methods of Data Collection in ... - NCBI
Continuous data collection systems are those that capture every possible behavioral occurrence, either by recording each instance of a behavior (i.e., frequency ...
Read more >
module 3: aba - part 3 Flashcards - Quizlet
duration is a continuous measurement procedure that involves: ... performance of a target b occurs in environs diff than the original training environ....
Read more >
Interval Recording - ABA Connect
Time Sampling: Refers to a variety of methods to record behavior at ... and partial and whole-interval recording are discontinuous methods.
Read more >
Procedures and Accuracy of Discontinuous Measurement of ...
PDF | Discontinuous measurement involves dividing an observation into intervals and recording whether a behavior occurred during some or all ...
Read more >
Data Collection Methods: Continuous vs Discontinuous ...
Again, duration could measure both behaviors you want to increase as well as those you are looking to decrease. Amount of time spent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found