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

Automated primary detection #2603

Merged
merged 12 commits into from
Nov 26, 2020

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented Jun 11, 2020

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.

@@ -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);
Copy link
Member

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.

Copy link
Member Author

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;
Copy link
Member

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.

@pleroy pleroy added the LGTM label Aug 23, 2020
@eggrobin eggrobin closed this Nov 15, 2020
@eggrobin eggrobin reopened this Nov 26, 2020
@eggrobin eggrobin merged commit 51ea935 into mockingbirdnest:master Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants