Skip to content

Track the Sat

Amie DD edited this page May 25, 2020 · 1 revision

Track The Sat

from pyorbital.orbital import Orbital
import datetime

tle = tlefile.read('IRIDIUM 103', 'active.txt')
orb = Orbital('IRIDIUM 103', tle_file='active.txt')

time = 1586622367.368198

def angle_to_servos(angle):
    val = angle / 180.0
    val = int(val * (7372 - 2457))
    val += 2457
    return val

for i in range(720):
    t = datetime.datetime.utcfromtimestamp(time+i)
    angles = orb.get_observer_look(t, 40.1, -3.21, 0)

    ts = time+i
    a0 = angle_to_servos(angles[0])
    a1 = angle_to_servos(angles[1])
    print(f"{ts}, {a0}, {a1}")
    ```
    
    ![3db903c48273efdc214f3ddff80a7a30.png](:/74c950f1e6874c59b60107b420063bc1)
Clone this wiki locally