Latitude and longitude positions are wrong, why? #887
Unanswered
rafelsalgueiro
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm trying to display in the google earth the orbit of some satellites and when I push the coordinates of the orbit it get a strange orbit. The orbit is not a line, in the north and the south pole start to spin, can someone help me please?
this is the script i'm using.
`
from skyfield.api import Loader, EarthSatellite, load
import math
import requests
import sys
from datetime import timedelta
def radians_to_degrees(radians):
return radians * (180.0 / math.pi)
def satellite_coordinates_to_dd(latitude_rad, longitude_rad):
latitude_dd = radians_to_degrees(latitude_rad)
longitude_dd = radians_to_degrees(longitude_rad)
return latitude_dd, longitude_dd
satellite_name = sys.argv[1]
url = f"https://celestrak.org/NORAD/elements/gp.php?NAME={satellite_name}&FORMAT=tle"
response = requests.get(url)
tle_lines = response.text.splitlines()
L1 = tle_lines[1]
L2 = tle_lines[2]
load = Loader('~/Documents/fishing/SkyData')
ts = load.timescale()
Roadster = EarthSatellite(L1, L2)
start_time = ts.now()
end_time = start_time.utc_datetime() + timedelta(hours=1)
interval = timedelta(minutes=0.5)
coords = []
current_time = start_time
while current_time.utc_datetime() < end_time:
subpoint = Roadster.at(current_time).subpoint()
latitude_rad = subpoint.latitude.radians
longitude_rad = subpoint.longitude.radians
altitude_km = subpoint.elevation.km
`
Beta Was this translation helpful? Give feedback.
All reactions