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

pass_iterators iter_passes() fails when location is above the orbit #131

Open
matiasg opened this issue Mar 3, 2025 · 1 comment
Open

Comments

@matiasg
Copy link
Contributor

matiasg commented Mar 3, 2025

How to reproduce:

In [33]: from orbit_predictor.predictors.pass_iterators import LocationPredictor, SmartLocationPredictor
In [34]: from orbit_predictor.predictors.numerical import J2Predictor
In [35]: from datetime import datetime, timedelta
In [36]: from orbit_predictor.locations import Location
In [37]: p = J2Predictor.sun_synchronous(alt_km=500, ltan_h=10, ecc=0)
In [38]: l = Location("way above", latitude_deg=0, longitude_deg=0, elevation_m=501_000)
In [39]: pit = p.passes_over(l, datetime.now(), datetime.now() + timedelta(days=30), location_predictor_class=LocationPredictor)
In [40]: next(pit.iter_passes())
---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
Cell In[40], line 1
----> 1 next(pit.iter_passes())

StopIteration:

Same thing happens with

pit = p.passes_over(l, datetime.now(), datetime.now() + timedelta(days=30), location_predictor_class=SmartLocationPredictor)

while for a Location enough below the orbit, it works fine

In [55]: l = Location("not so above", latitude_deg=0, longitude_deg=0, elevation_m=401_000)
In [56]: pit = p.passes_over(l, datetime.now(), datetime.now() + timedelta(days=30), location_predictor_class=SmartLocationPredictor)
In [57]: next(pit.iter_passes())
Out[57]: <PredictedPass <custom> over not so above on 2025-03-03 21:48:40.760214>
@matiasg
Copy link
Contributor Author

matiasg commented Mar 3, 2025

The problem seems to lie in AccuratePredictedPass:

    @property
    def valid(self):
        return self.max_elevation > 0 and self.aos is not None and self.los is not None

The elevation will never be positive for a location above the orbit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant