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

Propagator kepler crashes when propagating a hyperbolic orbit 0 seconds #477

Closed
astrojuanlu opened this issue Oct 22, 2018 · 7 comments
Closed

Comments

@astrojuanlu
Copy link
Member

@astrojuanlu astrojuanlu commented Oct 22, 2018

Comes from #474, by @TimothySHamilton

There is an untested code path that would make the kepler propagator crash if the eccentricity is greater than 1 and the propagation time is 0:

xi_new = (np.sign(tof) * (-1 / alpha)**.5 *
np.log((-2 * k * alpha * tof) /
(dot_r0v0 + np.sign(tof) *
np.sqrt(-k / alpha) * (1 - norm_r0 * alpha))))

This is similar to #328, but on a different level. It should be easy to fix, and requires us to add this code to propagate:

if time_of_flight.value == 0:
    return orbit

We should strive to make this change for all the methods, as an efficiency measure.

@aarribas
Copy link

@aarribas aarribas commented Oct 24, 2018

Since it's an easy fix, may I take care of it as an entry point to contribute to the project?

@astrojuanlu
Copy link
Member Author

@astrojuanlu astrojuanlu commented Oct 24, 2018

@astrojuanlu
Copy link
Member Author

@astrojuanlu astrojuanlu commented Oct 24, 2018

@aarribas and I forgot to say: thanks so much! :)

@aarribas
Copy link

@aarribas aarribas commented Oct 25, 2018

I had in mind to include the test(s) too, of course.

@aarribas
Copy link

@aarribas aarribas commented Oct 25, 2018

I noticed the function documentation comments are not consistent : Kepler function has none whereas mean_motion has some. The parameters are also inconsistently commented. May I also improve on that? Incidentally, I had a look at other .py in /core and noticed that a lot of doc comments where removed when the functions where "jitted". Was this intented? I found them useful.

@astrojuanlu
Copy link
Member Author

@astrojuanlu astrojuanlu commented Oct 25, 2018

@aarribas definitely - documentation is important to us, and if you noticed these inconsistencies we would be very happy if you fixed them as well (perhaps in separate commits though, so the review is easier). Also, we moved lots of functions to core in a rush, the day of the release, and at 3 AM local time, so I admit we probably missed lots of docstrings in the process.

@astrojuanlu
Copy link
Member Author

@astrojuanlu astrojuanlu commented Jan 3, 2019

Fixed in #527

@astrojuanlu astrojuanlu closed this Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants