Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

RAAN from LTAN calculation off-by 180 degrees #841

Closed
noc0lour opened this issue Feb 14, 2020 · 1 comment · Fixed by #842
Closed

RAAN from LTAN calculation off-by 180 degrees #841

noc0lour opened this issue Feb 14, 2020 · 1 comment · Fixed by #842

Comments

@noc0lour
Copy link
Contributor

noc0lour commented Feb 14, 2020

The pull request which added RAAN from ltan function to twobody.angles module
shifts the angle by 180 degrees and it ends up having LTAN and LTDN switched around.

🐞 Problem

Verification with actual orbits obtained from TLEs shows this discrepancy

Example Sentinel-1:

In [1]: import astropy.time

In [2]: import astropy.units as u

In [3]: from poliastro import twobody

In [4]: s1_epoch = astropy.time.Time(astropy.time.Time('2020-01-01 00:00').to_value('mjd') + 45.05318108 - 1, format='mjd')

In [5]: twobody.angles.raan_from_ltan(s1_epoch, 18.00 * u.hourangle)
Out[5]: <Angle 593.23886941 deg>

In [6]: twobody.angles.raan_from_ltan(s1_epoch, 18.00 * u.hourangle).wrap_at(360 * u.deg)
Out[6]: <Angle 233.23886941 deg>

In [7]: twobody.angles.raan_from_ltan(s1_epoch, 18.00 * u.hourangle).wrap_at(360 * u.deg) - 180 * u.deg
Out[7]: <Angle 53.23886941 deg>

Value from Celestrak TLE for this: 53.8031

💡 Possible solutions

Removing -12 * u.hourangle from alpha

    alpha = (coordinates.Angle(ltan).wrap_at(24 * u.hourangle) - 12 * u.hourangle).to(
        u.rad
    )

I crosschecked with Sentinel-2, METOP-B and if I change this it checks out (+- 0.5 degree).
Calculation of the epoch coming from the TLE is a bit special since 2020-01-01 00:00 is expressed as 20001.0000 and thus I need to subtract 1.0 before calculating the appropriate MJD.

I've created this issue to discuss if this is actually wrong or if I'm just confusing something...

@astrojuanlu
Copy link
Member

Ooops, good catch @noc0lour! Labeling this as a bug

noc0lour added a commit to noc0lour/poliastro that referenced this issue Feb 19, 2020
Add unit tests checking calculated RAAN
against TLE values of known SSO satellites with published
LTAN

Closes poliastro#841
noc0lour added a commit to noc0lour/poliastro that referenced this issue Feb 20, 2020
Add unit tests checking calculated RAAN
against TLE values of known SSO satellites with published
LTAN

Closes poliastro#841
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants