Issue62 - Prediction of maximum elevation #67
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a function
predict_max_elevation(...)
for predicting the time for the maximum elevation of the next or the current pass. Solves issue #62.This turned out to be more problematic than I thought, since satellites in deep space can have multiple maxima. However, assuming there can only be at most two, the function is accurate enough for most purposes (though dependent on predict_next_aos/los' ability to find a proper pass). Tests check the derivative, sample the pass for higher elevations and check the consistency of the found time when having different starting points throughout the pass. This is checked for various passes and various types of orbits.
AOS/LOS functions were changed a bit for higher accuracy in problematic cases, and the tests were rewritten to check AOS/LOS in a more proper way for several passes. This should also be good preparation for increasing the numerical accuracy for #18.
Discussion questions:
The function returns the time for the max elevation, like
predict_next_aos/los
returns a time. Very consistent. But would it make more sense to return astruct predict_observation
? In most cases, the user needs the additional properties, not only the time, and would have to callpredict_orbit
andpredict_observe_orbit
again after callingpredict_max_elevation
.struct predict_observation
also has a time field.In general, not sure about the name
predict_max_elevation
, since it doesn't return an elevation.