SpaceNetLab / StarryNet

A novel experimentation framework that enables researchers to conveniently build credible and flexible experimental network environments (ENE) mimicking satellite dynamics and network behaviors of large-scale ISTNs.
MIT License
74 stars 12 forks source link

Question: Does Observer use any TLE file #15

Open duyang1893 opened 2 months ago

duyang1893 commented 2 months ago

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 commented 1 month ago

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}")