laika
laika copied to clipboard
RuntimeError: No orbit data found in Walkthrough.ipynb for G07 at 2018-01-07
Dear laika developers,
First of all, thank you for your excellent work on laikaGNSS!
I encountered a RuntimeError while running the Walkthrough.ipynb example notebook. The error occurs in the cell where dog.get_sat_info is called for satellite G07 at GPSTime.from_datetime(datetime(2018, 1, 7)).
Error Message:
RuntimeError: No orbit data found. For Time 2018-01-07 00:00:00 constellations (<ConstellationId.GPS: 0>, <ConstellationId.GLONASS: 6>) valid ephem types (<EphemerisType.FINAL_ORBIT: 1>, <EphemerisType.RAPID_ORBIT: 2>, <EphemerisType.ULTRA_RAPID_ORBIT: 3>)
Code Snippet (from the problematic cell in Walkthrough.ipynb):
# For example if we want the position and speed of satellite 7 (a GPS sat)
# at the start of January 7th 2018. Laika's custom GPSTime object is used throughout
# and can be initialized from python's datetime.
from datetime import datetime
from laika.gps_time import GPSTime
time = GPSTime.from_datetime(datetime(2018, 1, 7))
# We use RINEX3 PRNs to identify satellites
sat_prn = 'G07'
# This is the line that triggers the error:
sat_pos, sat_vel, sat_clock_err, sat_clock_drift, ephemeris = dog.get_sat_info(sat_prn, time)
print("Satellite's position in ECEF (m) : \n", sat_pos, '\n')
print("Satellite's velocity in ECEF (m/s) : \n", sat_vel, '\n')
print("Satellite's clock error (s) : \n", sat_clock_err, '\n\n')
# we can also get the pseudorange delay (tropo delay + iono delay + DCB correction)
# in the San Francisco area
receiver_position = [-2702584.60036925, -4325039.45362552, 3817393.16034817]
delay = dog.get_delay(sat_prn, time, receiver_position)
print("Satellite's delay correction (m) in San Fransisco \n", delay)
Traceback:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[3], line 11
9 # We use RINEX3 PRNs to identify satellites
10 sat_prn = 'G07'
---> 11 sat_pos, sat_vel, sat_clock_err, sat_clock_drift, ephemeris = dog.get_sat_info(sat_prn, time)
12 print("Satellite's position in ECEF (m) : \n", sat_pos, '\n')
13 print("Satellite's velocity in ECEF (m/s) : \n", sat_vel, '\n')
File /media/ls2410/winE/gitRepoNew/laikaGNSS/laika/astro_dog.py:285, in AstroDog.get_sat_info(self, prn, time)
284 def get_sat_info(self, prn, time):
--> 285 eph = self.get_eph(prn, time)
286 if eph:
287 return eph.get_sat_info(time)
File /media/ls2410/winE/gitRepoNew/laikaGNSS/laika/astro_dog.py:277, in AstroDog.get_eph(self, prn, time)
275 eph = None
276 if self.pull_orbit:
--> 277 eph = self.get_orbit(prn, time)
278 if not eph and self.pull_nav:
279 eph = self.get_nav(prn, time)
File /media/ls2410/winE/gitRepoNew/laikaGNSS/laika/astro_dog.py:131, in AstroDog.get_orbit(self, prn, time)
129 def get_orbit(self, prn: str, time: GPSTime):
130 skip_download = time in self.orbit_fetched_times
--> 131 orbit = self._get_latest_valid_data(self.orbits[prn], self.cached_orbit[prn], self.get_orbit_data, time, skip_download)
132 if orbit is not None:
133 self.cached_orbit[prn] = orbit
File /media/ls2410/winE/gitRepoNew/laikaGNSS/laika/astro_dog.py:383, in AstroDog._get_latest_valid_data(self, data, latest_data, download_data_func, time, skip_download, recv_pos)
381 download_data_func(time, recv_pos)
382 else:
--> 383 download_data_func(time)
384 latest_data = get_closest(time, data, recv_pos=recv_pos)
385 if is_valid(latest_data):
File /media/ls2410/winE/gitRepoNew/laikaGNSS/laika/astro_dog.py:223, in AstroDog.get_orbit_data(self, time)
221 ephems_sp3 = self.download_parse_orbit(time)
222 if sum([len(v) for v in ephems_sp3.values()]) < 5:
--> 223 raise RuntimeError(f'No orbit data found. For Time {time.as_datetime()} constellations {self.valid_const} valid ephem types {self.valid_ephem_types}')
224 self.add_ephem_fetched_time(ephems_sp3, self.orbit_fetched_times)
225 self.add_orbits(ephems_sp3)
It seems like the necessary orbit data for this specific time and satellite could not be downloaded or found. Could you please look into this?
Thank you for your time and help!