Skip to content

Instantly share code, notes, and snippets.

@kieranshanley
Last active July 20, 2022 23:52

Revisions

  1. kieranshanley revised this gist Jul 20, 2022. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions issTle
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ from tletools import TLE

    tle_string = """
    ISS (ZARYA)
    1 25544U 98067A 22201.02342443 .00008269 00000+0 15250-3 0 9999
    2 25544 51.6415 173.9494 0004948 29.0959 82.3667 15.50036788350272
    1 25544U 98067A 22201.40857775 .00008240 00000+0 15195-3 0 9997
    2 25544 51.6419 172.0419 0005020 30.4744 71.6173 15.50043356350332
    """

    tle_lines = tle_string.strip().splitlines()
    @@ -20,4 +20,5 @@ print("ECC", orbit.ecc)
    print("INC", orbit.inc)
    print("RAAN", orbit.raan)
    print("AOP", orbit.argp)
    print("TA = ", orbit.nu)
    print("TA = ", orbit.nu)
    print("Epoch = {}\n).format(orbit.epoch))
  2. kieranshanley created this gist Jul 20, 2022.
    23 changes: 23 additions & 0 deletions issTle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/usr/bin/python3

    from tletools import TLE

    tle_string = """
    ISS (ZARYA)
    1 25544U 98067A 22201.02342443 .00008269 00000+0 15250-3 0 9999
    2 25544 51.6415 173.9494 0004948 29.0959 82.3667 15.50036788350272
    """

    tle_lines = tle_string.strip().splitlines()

    tle = TLE.from_lines(*tle_lines)

    orbit = tle.to_orbit()
    print("TLE = ", tle_string)
    print()
    print("SMA = ", orbit.a)
    print("ECC", orbit.ecc)
    print("INC", orbit.inc)
    print("RAAN", orbit.raan)
    print("AOP", orbit.argp)
    print("TA = ", orbit.nu)