Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Does Observer use any TLE file #15

Open
duyang1893 opened this issue Sep 9, 2024 · 1 comment
Open

Question: Does Observer use any TLE file #15

duyang1893 opened this issue Sep 9, 2024 · 1 comment

Comments

@duyang1893
Copy link

Hi,

Quote from the 2023-StrarryNet paper: "The constellation observer is designed as a collector for constellation-relevant information, and it maintains three databases related to satellite, ground station and user terminal information respectively."

Are these implemented already in the source code?
I can see in the sn_observer.py that satellite is built using sgp4init and EarthSatellite.from_satrec functions. It seems TLE file are not used. Maybe I have missed something? Thanks!

@xiex386
Copy link
Contributor

xiex386 commented Sep 18, 2024

Thanks for your interest in our work.
TLE file is not the main focus of this work. There's some websites where you can get the latest TLE data, like CelesTrak, Space Track.
If you want to use these TLEs, you can use the library skyfield to convert them to longitudes, latitudes and heights, like this:

from skyfield.api import load, EarthSatellite, wgs84

ts = load.timescale()
with open('Starlink.tle', 'r') as f:
    for line in f:
        line1 = f.readline()
        line2 = f.readline()
        sat = EarthSatellite(line1, line2, line, ts)
        geocentric = sat.at(ts.utc(2024, 9, 15, 11, 18, 7))
        lat, lon = wgs84.latlon_of(geocentric)
        height = wgs84.height_of(geocentric)
        print(f"{lat.degrees}, {lon.degrees}, {height.km}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants