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

RAAN from LTAN calculation off-by 180 degrees #841

@noc0lour

Description

@noc0lour

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...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions