-
Notifications
You must be signed in to change notification settings - Fork 69
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
Automated primary detection #2603
Automated primary detection #2603
Conversation
@@ -106,7 +107,9 @@ void OrbitAnalyser::RepeatedlyAnalyseOrbit() { | |||
trajectory.back().time < | |||
parameters->first_time + parameters->mission_duration; | |||
t += parameters->mission_duration / 0x1p10) { | |||
auto const flow_status = ephemeris_->FlowWithFixedStep(t, *instance); |
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.
Unused variable? This code is weird.
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.
Yes, see the TODO below. Keeping it as a reminder that this thing has a status that we should really use.
|
||
Instant first_time_; | ||
Time mission_duration_; | ||
not_null<RotatingBody<Barycentric> const*> primary_; | ||
RotatingBody<Barycentric> const* primary_ = nullptr; |
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.
Please fix the usages of this member. In particular, primary()
must probably return an optional and the caller(s) need to change.
When there is an ambiguity (e.g., an Earth orbit is a heavily perturbed Solar orbit), use the body for which the current osculating orbit is shortest. This appears to work well whenever there is a reasonably-Keplerian orbit.
For fancier ambiguous situations (e.g., the maccollo square), using the shortest sidereal period would likely be more robust, as with this method we will switch between bodies along the orbit; however, there is no obviously right answer in such cases anyway: neither orbit is even close to Keplerian, and the numbers produced by the analyser for either are of questionable use.
Computing the mean sidereal period for all bodies is very costly; let us pick the cheap option.