-
-
Notifications
You must be signed in to change notification settings - Fork 276
Attractor surface visibility #1298
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1298 +/- ##
==========================================
+ Coverage 92.25% 92.29% +0.03%
==========================================
Files 81 81
Lines 4260 4281 +21
Branches 358 358
==========================================
+ Hits 3930 3951 +21
Misses 248 248
Partials 82 82
Continue to review full report at Codecov.
|
a16799b
to
6ef408c
Compare
We had discussed whether the addition of elevation wouldn't get too complicated. It seems we could add the |
I guess this is somewhat related to #1299, could you clarify what are the differences between the two? |
Satellite visibility aims to detect when a satellite becomes visible from a ground station on an attractor whereas satellite view (here) tries to detect the case when a satellite will be able to view the sunlit part of its attractor. So the satellite view event:
From Escobal's book: Hence, the geometry seems to be almost the opposite of the eclipse event |
3abaa88
to
2735350
Compare
As decided earlier, the added test checks eclipse doesn't trigger when satellite view triggers. This might not be as robust as a check since I think there could be situations where neither event is triggered. But such a test could be a good starting point. I think this is ready to be reviewed. |
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 this is good to go!
I did a very short-sighted review and @Yash-10 rightly told me that the tests are incomplete. Removing the approval, sorry for the noise 🙏🏽 |
2735350
to
10eb1b4
Compare
Slight modify event test
10eb1b4
to
c848334
Compare
c848334
to
5dbd677
Compare
2dd174b
to
8fe9992
Compare
For validating this event, I am trying to use this equation from Escobal's book (Page 155 under Analytics of the Two-body problem): I believe the variable diff --git a/tests/tests_twobody/test_events.py b/tests/tests_twobody/test_events.py
index 898a568a..08de0603 100644
--- a/tests/tests_twobody/test_events.py
+++ b/tests/tests_twobody/test_events.py
@@ -11,7 +11,7 @@ from poliastro.core.events import line_of_sight
from poliastro.core.perturbations import atmospheric_drag_exponential
from poliastro.core.propagation import func_twobody
from poliastro.twobody import Orbit
-from poliastro.twobody.angles import nu_to_E
+from poliastro.twobody.angles import nu_to_E, E_to_M
from poliastro.twobody.elements import mean_motion
from poliastro.twobody.events import (
AltitudeCrossEvent,
@@ -484,11 +484,11 @@ def test_satellite_view_event():
epoch = Time("2020-01-01", scale="utc")
coe = (
6828137.0 * u.m,
0.0073 * u.one,
87.0 * u.deg,
20.0 * u.deg,
10.0 * u.deg,
0 * u.deg,
)
orbit = Orbit.from_classical(attractor, *coe, epoch=epoch)
@@ -515,7 +515,8 @@ def test_satellite_view_event():
n = mean_motion(orb.attractor.k, orb.a)
# Equation 5.14 from Escobal.
- expected_view_t = t_perigee + (E - ecc * np.sin(E) * u.rad) / n
+ M = E_to_M(E, ecc)
+ expected_view_t = t_perigee + M / n
assert_quantity_allclose(satellite_view_event.last_t, expected_view_t) |
Hi @Yash-10, you may also use the logic from the poliastro/src/poliastro/twobody/orbit.py Lines 233 to 244 in 2eb557c
|
(Renaming this PR for clarity) |
I wonder if:
could be used somehow for validation? Also, using the above equation from Escobal was a bit tough for me. Even though one could get the eccentric anomaly and mean motion at the event instance, getting the time of perifocal passage (and not since the perifocal passage) is still confusing. One idea might be to get the time of perifocal passage from the orbit epoch. |
This is an attempt inspired by section 5.2 ("Direct Visibility of a Planetary Surface") of Escobal's book and uses equation 5.5.
As mentioned in the book, this might have application for planetary probes to study some properties of a planet, its composition, atmosphere, etc.
Just added a test to check if it doesn't give any errors.