-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fixing SimpleTransitOrbit
duration
#148
Conversation
I don't think that this is quite what we want. The In the current implementation, we define the orbit as:
where
Where Instead, we want it to be:
where So: I think that we should accept
|
Hey @dfm thanks for the feedback this is great! That definitely fixes the duration issue, I've implemented it and it looks good! My fix with this line was to make it so Alternatively, setting that line to would mean the planet is always in front of the planet, and then we wouldn't need to prescribe For the |
src/exoplanet/orbits/simple.py
Outdated
self.duration = as_tensor_variable(duration) | ||
else: | ||
raise ValueError("`duration` must be provided.") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
period
is also required. How about we change the function signature to:
def __init__(self, *, period, duration, t0=0.0, b=0.0, r_star=1.0, ror=0.0):
and remove this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely happy to do this, I'll just have to update the tests because they're specified without kwarg names e.g SimpleTransitOrbit(period, t0, b, r_star, duration)
. Are you ok with me doing that?
Awesome - thanks! Yeah - the |
(PS don't worry about the failing tutorials workflow it's not set up to work with PRs - something I need to fix!) |
I implemented the suggested change, and yes now the |
Thanks Christina! |
This PR fixes #147.
The issue is that the transit from
SimpleTransitOrbit
does not match the transit fromKeplerianOrbit
when given reasonable parameters.This PR also fixes:
SimpleTransitOrbit
has a defaultduration
of None, which can not be initialized. Now raises a ValueError.SimpleTransitOrbit
did not accept a semimajor axis parameter. Now acceptsa
as an input, and will calculateduration
from that value.SimpleTransitOrbit
matchesKeplarianOrbit
at long period and reasonableb
.