Closed xrael closed 4 years ago
Thanks a lot @xrael! I see these failures in the CI:
=================================== FAILURES ===================================
_ SunSynchronousTests.test_sun_sync_delta_true_anomaly_has_expected_anomaly_and_epoch _
self = <test_numerical_predictor.SunSynchronousTests testMethod=test_sun_sync_delta_true_anomaly_has_expected_anomaly_and_epoch>
def test_sun_sync_delta_true_anomaly_has_expected_anomaly_and_epoch(self):
date = dt.datetime.today().date()
ltan_h = 12
expected_ref_epoch = dt.datetime(date.year, date.month, date.day, 12)
for expected_ta_deg in [-30, 0, 30]:
pred = J2Predictor.sun_synchronous(
alt_km=800, ecc=0, date=date, ltan_h=ltan_h, ta_deg=expected_ta_deg
)
ta_deg = pred.get_position(expected_ref_epoch).osculating_elements[5]
> self.assertAlmostEqual(ta_deg, expected_ta_deg % 360, places=12)
E AssertionError: 360.0 != 0 within 12 places (360.0 difference)
would you like to address them?
ooops. I'm sorry :) Isn't that weird? I did not put my hands on that part of the code. I can try to fix it, definitely
Oh sorry, I looked quickly and thought it was the test you added. I'll take care of it separately.
I cannot even reproduce the error. When I run that test, it passes smoothly
Floating point weirdness strikes back.
>>> from math import pi
>>> v = -9.812684231690591e-18
>>> v % (2 * pi)
6.283185307179586
>>> v % (2 * pi) % (2 * pi)
0.0
@xrael I fixed the rogue test and changed the CI system, would you like to rebase your PR?
Thanks a lot @xrael ! Merging when the pipelines pass
orbit-predictor has a util to convert from ltan to raan. I happened to need the opposite util and I've decided to propose to add this to repo.