commaai / laika

Simple Python GNSS processing library
MIT License
634 stars 178 forks source link

No orbit data #117

Closed HubertStudent closed 1 year ago

HubertStudent commented 1 year ago

I just installed laika library, and everything looks ok but I'm getting an error: No orbit data found. For Time 2018-01-07 00:00:00 constellations ['GPS', 'GLONASS'] valid ephem types (<EphemerisType.FINAL_ORBIT: 1>, <EphemerisType.RAPID_ORBIT: 2>, <EphemerisType.ULTRA_RAPID_ORBIT: 3>)

even when I'm using excactly the same code that is provided in Walktrough. I must say that I'm getting this error for any consellation and time I use. I tried with python 3.11 and 3,8.0

gast04 commented 1 year ago

where you get this issue? I just run the Walkthrough and works fine for me

HubertStudent commented 1 year ago

I got it in Spyder 5

gast04 commented 1 year ago

meant which part of the code, like a full stacktrace would be nice, I need more info to check that, I dont use spyder, using jupyter notebook

HubertStudent commented 1 year ago

Ok: pasting full error info:


RuntimeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_17904\3327669075.py in <cell line: 0>() 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')

~\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py in get_sat_info(self, prn, time) 263 eph = None 264 if self.pull_orbit: --> 265 eph = self.get_orbit(prn, time) 266 if not eph and self.pull_nav: 267 eph = self.get_nav(prn, time)

~\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py in get_orbit(self, prn, time) 104 def get_orbit(self, prn: str, time: GPSTime): 105 skip_download = time in self.orbit_fetched_times --> 106 orbit = self._get_latest_valid_data(self.orbits[prn], self.cached_orbit[prn], self.get_orbit_data, time, skip_download) 107 if orbit is not None: 108 self.cached_orbit[prn] = orbit

~\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py in _get_latest_valid_data(self, data, latest_data, download_data_func, time, skip_download, recv_pos) 361 download_data_func(time, recv_pos) 362 else: --> 363 download_data_func(time) 364 latest_data = get_closest(time, data, recv_pos=recv_pos) 365 if is_valid(latest_data):

~\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py in get_orbit_data(self, time, only_predictions) 209 ephems_sp3 = self.download_parse_orbit(time) 210 if sum([len(v) for v in ephems_sp3.values()]) < 5: --> 211 raise RuntimeError(f'No orbit data found. For Time {time.as_datetime()} constellations {self.valid_const} valid ephem types {self.valid_ephem_types}') 212 213 self.add_orbits(ephems_sp3)

RuntimeError: No orbit data found. For Time 2018-01-07 00:00:00 constellations ['GPS', 'GLONASS'] valid ephem types (<EphemerisType.FINAL_ORBIT: 1>, <EphemerisType.RAPID_ORBIT: 2>, <EphemerisType.ULTRA_RAPID_ORBIT: 3>)

gast04 commented 1 year ago

ahmmn, its downloading orbit information from web, I can only reproduce this if I disable internet, you sure you have internet access? I guess you have to investigate on your end here

gast04 commented 1 year ago

maybe also try deleting the cache dir /tmp/gnss

HubertStudent commented 1 year ago

Yes, my internet works fine. Do you have any ideas what should I check ?

gast04 commented 1 year ago

check the cache directory if it downloads anything, on the first run you should see the download lines like:

Downloading https://github.com/commaai/gnss-data-alt/raw/master/MCC/PRODUCTS/18006/final/Sta19826.sp3
Downloading https://github.com/commaai/gnss-data-alt/raw/master/MCC/PRODUCTS/18007/final/Sta19830.sp3
Downloading https://github.com/commaai/gnss-data-alt/raw/master/MCC/PRODUCTS/18008/final/Sta19831.sp3
Downloading https://github.com/commaai/gnss-data/raw/master/gnss/products/1982/igs19826.sp3.Z
Downloading https://github.com/commaai/gnss-data/raw/master/gnss/products/1983/igs19830.sp3.Z
Downloading https://github.com/commaai/gnss-data/raw/master/gnss/products/1983/igs19831.sp3.Z
Satellite's position in ECEF (m) : 
 [-19501731.53   -7580440.439  16817823.825] 

Satellite's velocity in ECEF (m/s) : 
 [1993.27528306 -613.07074562 2016.32438942] 

Satellite's clock error (s) : 
 0.00025521380390669117 

Downloading https://github.com/commaai/gnss-data/raw/master/gnss/products/ionex/2018/007/codg0070.18i.Z
Downloading https://github.com/commaai/gnss-data/raw/master/gnss/products/bias/2018/CAS0MGXRAP_20180070000_01D_01D_DCB.BSX.gz
Satellite's delay correction (m) in San Fransisco 
 3.1049571045513886
HubertStudent commented 1 year ago

Yes, I have it, now the tmp/gnss has some rusian products and cddis products, but the error in console is still the same EDIT: the last call from the console is: Downloading https://github.com/commaai/gnss-data/tree/master/gnss/products1983/igu19830_00.sp3.Z Traceback (most recent call last):

File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\spyder_kernels\py3compat.py", line 356, in compat_exec exec(code, globals, locals)

File "c:\users\admin\desktop\studia\programowanie\cwiczenia2\untitled0.py", line 28, in sat_pos, sat_vel, sat_clock_err, sat_clock_drift, ephemeris = dog.get_sat_info(sat_prn, time)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py", line 265, in get_sat_info eph = self.get_orbit(prn, time)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py", line 106, in get_orbit orbit = self._get_latest_valid_data(self.orbits[prn], self.cached_orbit[prn], self.get_orbit_data, time, skip_download)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py", line 363, in _get_latest_valid_data download_data_func(time)

File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\laika-0.0.1-py3.11.egg\laika\astro_dog.py", line 211, in get_orbit_data raise RuntimeError(f'No orbit data found. For Time {time.as_datetime()} constellations {self.valid_const} valid ephem types {self.valid_ephem_types}')

RuntimeError: No orbit data found. For Time 2018-01-07 00:00:00 constellations ['GPS', 'GLONASS'] valid ephem types (<EphemerisType.FINAL_ORBIT: 1>, <EphemerisType.RAPID_ORBIT: 2>, <EphemerisType.ULTRA_RAPID_ORBIT: 3>)

gast04 commented 1 year ago

yea that url doesnt exist, that would explain it, cant really tell tbh, seems something is off in the downloader, best to track down why the download of the other orbits is not working

HubertStudent commented 1 year ago

Hm strange, I checked if my astro dog and downloader file is the same with that one at github and its excactly the same code... I'm not an expert so its difficult for me to find out the issue, but thanks for help, I appreciate that

gast04 commented 1 year ago

another guess might be that the default cache dir doesnt work for you as its /tmp/gnss and you are on Windows right? maybe changeing it might already fix it

sure no problem, let me know when you found it