-
-
Notifications
You must be signed in to change notification settings - Fork 801
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
Exclude outdated solar system objects #1880
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files |
Hello @alex-w! Thank you for this enhancement. |
The user would benefit from being informed about the problem, as it is not obvious that ephemeris data is outdated (as we can judge from several issues that are reported), especially for comets/asteroids, as these require the user to open the Solar System Editor, which is a tad hairy to manipulate. All too often the users assume that the data is always up-to-date, which is obviously NOT the case. So until an automatic update is possible, the user should be aware of the problem. at least emit a stellarium/src/core/modules/SolarSystem.cpp Line 852 in bc5ee58
nicer but much more expensive is to (also) highlight outdated objected in the tabular GUIs (eg grey/italic?) |
@@ -4473,6 +4480,19 @@ QMap<double, double> AstroCalcDialog::findClosestApproach(PlanetP& object1, Stel | |||
QMap<double, double> separations; | |||
QPair<double, double> extremum; | |||
|
|||
if (object2->getType()=="Planet") |
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.
Hmm, do you also see the inefficiency?
For a simple date validity test you set the whole program state twice.
Please do the following: extend
bool Planet::hasValidPositionalData(const double jde)
{
if (pType<isObserver)
return true;
else if (orbitPtr && pType>=isArtificial)
return static_cast<KeplerOrbit*>(orbitPtr)->objectDateValid(jde);
else
return false;
}
And then you can simply test here:
if ( (!planet->hasValidPositionalData(stopJD)) || (!planet->hasValidPositionalData(startJD)) )
return separations; // empty result.
And probably this is not even what we need here? Imagine some object with orbit_good=100 (days)
You make an ephemeris for 250 days which enclose the orbit's validity range. The object would be excluded with the current solution! Maybe add a test for (startJD+stopJD)/2? Or sample every 50 days between startJD and stopJD? Or is there a limit or typical value for (stopJD-startJD)? If this is always something like 10 days, you could exclude the object if both dates are invalid.
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.
I've added JDE as parameter to reduce number of calls, but for second proposal I think it should be postponed to the future releases, because this subsystem should be refactored after pencil and paper works.
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.
OK. The inefficiency is solved.
The next question is just what this function should do. Is this logic correct? Whenever at least one limit of the search interval is outside the validity range for the planet, the planet is discarded. I see a danger of another error. If you need to merge this now, leave a FIXME with this question for later, and maybe somebody reports an error. Else please don't merge, and let's solve this with better tests for the overlapping cases. (We may need to add some really simple date validity queries to the Planet.)
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 add the QWarning()
logging, or some other warning mechanism. the QWarning()
is not much asked, and will help if a user opens an issue; the log will explain what happened.
thank you!
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.
The next question is just what this function should do. Is this logic correct?
Yes, but I'll change it as first iteration of excluding the data.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This pull request introduces 2 alerts when merging 927a249 into 96c0334 - view on LGTM.com new alerts:
|
I found today this issue too and this is puzzled me... |
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.
I think the purpose of the branch is fulfilled. Newly found old weirdnesses which we now have found should be fixed in other issues/PRs. (0.21.1 finds the same things, so that's not a problem of this PR.)
I'm work on fix of founded issue - just testing the fix right now in this branch |
…AstroCalc/Phenomena tool
OK, please check the fix |
OK. No more eclipses Neptune/Jupiter. |
Please check the latest stable version of Stellarium: |
Description
Excluding the Solar system objects with outdated data from ephemeris, positions and phenomena computations
Fixes #1564
Screenshots (if appropriate):
v0.21.1:
![stellarium-006](https://user-images.githubusercontent.com/88731/132953223-2d09cc2b-6f7a-4f5a-b521-23910e246d65.jpg)
v0.21.1-122fe98:
![stellarium-007](https://user-images.githubusercontent.com/88731/132953276-fa92e6db-39b8-4cf7-8177-86a3ff8ce432.jpg)
Type of change
How Has This Been Tested?
Load 1000 comets data file.
Use AstroCalc/Phenomena (AstroCalc/Positions or AstroCalc/Ephemeris also) to search for phenomena around Jupiter's moons, e.g. June to September 2021.
Checklist: