Skip to content

Commit dd523ba

Browse files
authored
Remove russian crap, and simplify downloading (#168)
* Remove russian crap, and simplify downloading * Lint problem * dead code * cleanups * lint * Passes some tests finally * lint * lint * no init * More stable * fix more tests * test positioning
1 parent 28cb5d9 commit dd523ba

File tree

9 files changed

+78
-203
lines changed

9 files changed

+78
-203
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ repos:
1818
- --warn-return-any
1919
- --warn-unreachable
2020
- --warn-unused-ignores
21+
- --explicit-package-bases
2122
- repo: https://github.com/astral-sh/ruff-pre-commit
2223
rev: v0.2.2
2324
hooks:

laika/astro_dog.py

Lines changed: 20 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import os
22
from collections import defaultdict
33
from concurrent.futures import ThreadPoolExecutor
4-
from typing import DefaultDict
4+
from typing import DefaultDict, Sequence, Mapping
55
from collections.abc import Iterable
66

7-
from .constants import SECS_IN_DAY, SECS_IN_HR
7+
from .constants import SECS_IN_DAY
88
from .helpers import ConstellationId, get_constellation, get_closest, get_el_az, TimeRangeHolder
99
from .ephemeris import Ephemeris, EphemerisType, GLONASSEphemeris, GPSEphemeris, PolyEphemeris, parse_sp3_orbits, parse_rinex_nav_msg_gps, \
1010
parse_rinex_nav_msg_glonass
11-
from .downloader import download_orbits_gps, download_orbits_russia_src, download_nav, download_ionex, download_dcb, download_prediction_orbits_russia_src
11+
from .downloader import download_orbits_gps, download_nav, download_ionex, download_dcb
1212
from .downloader import download_cors_station
1313
from .trop import saast
1414
from .iono import IonexMap, parse_ionex, get_slant_delay
@@ -63,11 +63,11 @@ def __init__(self, auto_update=True,
6363
self.dcbs_fetched_times = TimeRangeHolder()
6464

6565
self.dgps_delays = []
66-
self.ionex_maps: list[IonexMap] = []
67-
self.orbits: DefaultDict[str, list[PolyEphemeris]] = defaultdict(list)
68-
self.qcom_polys: DefaultDict[str, list[PolyEphemeris]] = defaultdict(list)
69-
self.navs: DefaultDict[str, list[GPSEphemeris | GLONASSEphemeris]] = defaultdict(list)
70-
self.dcbs: DefaultDict[str, list[DCB]] = defaultdict(list)
66+
self.ionex_maps: Sequence[IonexMap] = []
67+
self.orbits: DefaultDict[str, Sequence[PolyEphemeris]] = defaultdict(list)
68+
self.qcom_polys: DefaultDict[str, Sequence[PolyEphemeris]] = defaultdict(list)
69+
self.navs: DefaultDict[str, Sequence[GPSEphemeris | GLONASSEphemeris]] = defaultdict(list)
70+
self.dcbs: DefaultDict[str, Sequence[DCB]] = defaultdict(list)
7171

7272
self.cached_ionex: IonexMap | None = None
7373
self.cached_dgps = None
@@ -160,16 +160,16 @@ def get_dgps_corrections(self, time, recv_pos):
160160
self.cached_dgps = latest_data
161161
return latest_data
162162

163-
def add_qcom_polys(self, new_ephems: dict[str, list[Ephemeris]]):
163+
def add_qcom_polys(self, new_ephems: Mapping[str, Sequence[Ephemeris]]):
164164
self._add_ephems(new_ephems, self.qcom_polys)
165165

166-
def add_orbits(self, new_ephems: dict[str, list[Ephemeris]]):
166+
def add_orbits(self, new_ephems: Mapping[str, Sequence[Ephemeris]]):
167167
self._add_ephems(new_ephems, self.orbits)
168168

169-
def add_navs(self, new_ephems: dict[str, list[Ephemeris]]):
169+
def add_navs(self, new_ephems: Mapping[str, Sequence[Ephemeris]]):
170170
self._add_ephems(new_ephems, self.navs)
171171

172-
def _add_ephems(self, new_ephems: dict[str, list[Ephemeris]], ephems_dict):
172+
def _add_ephems(self, new_ephems: Mapping[str, Sequence[Ephemeris]], ephems_dict):
173173
for k, v in new_ephems.items():
174174
if len(v) > 0:
175175
if self.clear_old_ephemeris:
@@ -208,41 +208,17 @@ def download_and_parse(constellation, parse_rinex_nav_func):
208208
end_day = GPSTime(time.week, SECS_IN_DAY * (1 + (time.tow // SECS_IN_DAY)))
209209
self.navs_fetched_times.add(begin_day, end_day)
210210

211-
def download_parse_orbit(self, gps_time: GPSTime, skip_before_epoch=None) -> dict[str, list[PolyEphemeris]]:
211+
def download_parse_orbit(self, gps_time: GPSTime, skip_before_epoch=None) -> Mapping[str, Sequence[PolyEphemeris]]:
212212
# Download multiple days to be able to polyfit at the start-end of the day
213213
time_steps = [gps_time - SECS_IN_DAY, gps_time, gps_time + SECS_IN_DAY]
214214
with ThreadPoolExecutor() as executor:
215-
futures_other = [executor.submit(download_orbits_russia_src, t, self.cache_dir, self.valid_ephem_types) for t in time_steps]
216-
futures_gps = None
217-
if ConstellationId.GPS in self.valid_const:
218-
futures_gps = [executor.submit(download_orbits_gps, t, self.cache_dir, self.valid_ephem_types) for t in time_steps]
219-
220-
files_other = [self.fetch_count(f.result()) for f in futures_other if f.result()]
221-
ephems_other = parse_sp3_orbits(files_other, self.valid_const, skip_before_epoch)
222-
files_gps = [self.fetch_count(f.result()) for f in futures_gps if f.result()] if futures_gps else []
223-
ephems_us = parse_sp3_orbits(files_gps, self.valid_const, skip_before_epoch)
224-
225-
return {k: ephems_other.get(k, []) + ephems_us.get(k, []) for k in set(list(ephems_other.keys()) + list(ephems_us.keys()))}
226-
227-
def download_parse_prediction_orbit(self, gps_time: GPSTime):
228-
assert EphemerisType.ULTRA_RAPID_ORBIT in self.valid_ephem_types
229-
skip_until_epoch = gps_time - 2 * SECS_IN_HR
230-
231-
result = self.fetch_count(download_prediction_orbits_russia_src(gps_time, self.cache_dir))
232-
if result is not None:
233-
result = [result]
234-
elif ConstellationId.GPS in self.valid_const:
235-
# Slower fallback. Russia src prediction orbits are published from 2022
236-
result = [self.fetch_count(download_orbits_gps(t, self.cache_dir, self.valid_ephem_types)) for t in [gps_time - SECS_IN_DAY, gps_time]]
237-
if result is None:
238-
return {}
239-
return parse_sp3_orbits(result, self.valid_const, skip_until_epoch=skip_until_epoch)
240-
241-
def get_orbit_data(self, time: GPSTime, only_predictions=False):
242-
if only_predictions:
243-
ephems_sp3 = self.download_parse_prediction_orbit(time)
244-
else:
245-
ephems_sp3 = self.download_parse_orbit(time)
215+
futures = [executor.submit(download_orbits_gps, t, self.cache_dir, self.valid_ephem_types) for t in time_steps]
216+
files = [self.fetch_count(f.result()) for f in futures if f.result()] if futures else []
217+
ephems = parse_sp3_orbits(files, self.valid_const, skip_before_epoch)
218+
return ephems
219+
220+
def get_orbit_data(self, time: GPSTime):
221+
ephems_sp3 = self.download_parse_orbit(time)
246222
if sum([len(v) for v in ephems_sp3.values()]) < 5:
247223
raise RuntimeError(f'No orbit data found. For Time {time.as_datetime()} constellations {self.valid_const} valid ephem types {self.valid_ephem_types}')
248224
self.add_ephem_fetched_time(ephems_sp3, self.orbit_fetched_times)

laika/downloader.py

Lines changed: 25 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from laika.ephemeris import EphemerisType
1818
from .constants import SECS_IN_HR, SECS_IN_DAY, SECS_IN_WEEK
19-
from .gps_time import GPSTime, tow_to_datetime
19+
from .gps_time import GPSTime
2020
from .helpers import ConstellationId
2121

2222
dir_path = os.path.dirname(os.path.realpath(__file__))
@@ -27,12 +27,6 @@
2727
# mirror of sftp://gdc.cddis.eosdis.nasa.gov/gnss/data/hourly
2828
CDDIS_HOURLY_BASE_URL = os.getenv("CDDIS_HOURLY_BASE_URL", "https://raw.githubusercontent.com/commaai/gnss-data-hourly/master")
2929

30-
# mirror of ftp://ftp.glonass-iac.ru
31-
GLONAS_IAC_BASE_URL = os.getenv("GLONAS_IAC_BASE_URL", "https://raw.githubusercontent.com/commaai/gnss-data-alt/master")
32-
33-
# no mirror
34-
IGN_BASE_URL = os.getenv("IGN_BASE_URL", "ftp://igs.ign.fr/pub")
35-
3630

3731
class DownloadFailed(Exception):
3832
pass
@@ -322,121 +316,39 @@ def download_nav(time: GPSTime, cache_dir, constellation: ConstellationId):
322316
folder_and_filenames, cache_dir+'hourly_nav/', compression, overwrite=True)
323317

324318

325-
def download_orbits_gps_cod0(time, cache_dir, ephem_types):
319+
def download_orbits_gps(time, cache_dir, ephem_types):
326320
url_bases = (
327321
mirror_url(CDDIS_BASE_URL, '/gnss/products/'),
322+
mirror_url(CDDIS_BASE_URL, '/glonass/products/'),
328323
)
329324

330-
if EphemerisType.ULTRA_RAPID_ORBIT not in ephem_types:
331-
# TODO: raise error here
332-
return None
333-
334-
tm = tow_to_datetime(time.tow, time.week).timetuple()
335-
doy = str(tm.tm_yday).zfill(3)
336-
filename = f"COD0OPSULT_{tm.tm_year}{doy}0000_02D_05M_ORB.SP3"
337-
# TODO: add hour management
338-
339325
folder_path = "%i/" % time.week
340-
folder_file_names = [(folder_path, filename)]
341-
return download_and_cache_file_return_first_success(url_bases, folder_file_names, cache_dir+'cddis_products/', compression='.gz')
342-
343-
def download_orbits_gps(time, cache_dir, ephem_types):
344-
url_bases = (
345-
mirror_url(CDDIS_BASE_URL, '/gnss/products/'),
346-
mirror_url(IGN_BASE_URL, '/igs/products/'),
347-
)
326+
filenames = []
327+
compression = '.gz'
348328

349329
if time.week < 2238:
350-
compression = '.Z'
351-
ephem_strs = {
352-
EphemerisType.FINAL_ORBIT: ['igs{wwww}{dow}.sp3'.format(wwww=time.week, dow=time.dow)],
353-
EphemerisType.RAPID_ORBIT: ['igr{wwww}{dow}.sp3'.format(wwww=time.week, dow=time.dow)],
354-
EphemerisType.ULTRA_RAPID_ORBIT: ['igu{wwww}{dow}_{hh}.sp3'.format(wwww=time.week, dow=time.dow, hh=hour) for hour in ['18', '12', '06', '00']]
355-
}
330+
assert EphemerisType.FINAL_ORBIT in ephem_types, f"Only final orbits are available before 2238, {ephem_types}"
331+
filenames.extend(['COD0MGXFIN_{yyyy}{doy:03d}0000_01D_05M_ORB.SP3'.format(yyyy=time.year, doy=time.doy)])
356332
else:
357333
# TODO deal with version number
358-
compression = '.gz'
359334
ephem_strs = {
360-
EphemerisType.FINAL_ORBIT: ['IGS0OPSFIN_{yyyy}{doy:03d}0000_01D_15M_ORB.SP3'.format(yyyy=time.year, doy=time.doy)],
361-
EphemerisType.RAPID_ORBIT: ['IGS0OPSRAP_{yyyy}{doy:03d}0000_01D_15M_ORB.SP3'.format(yyyy=time.year, doy=time.doy)],
362-
EphemerisType.ULTRA_RAPID_ORBIT: ['IGS0OPSULT_{yyyy}{doy:03d}{hh}00_02D_15M_ORB.SP3'.format(yyyy=time.year, doy=time.doy, hh=hour) \
335+
EphemerisType.FINAL_ORBIT: ['COD0OPSFIN_{yyyy}{doy:03d}0000_01D_05M_ORB.SP3'.format(yyyy=time.year, doy=time.doy)],
336+
EphemerisType.RAPID_ORBIT: ['COD0OPSRAP_{yyyy}{doy:03d}0000_01D_05M_ORB.SP3'.format(yyyy=time.year, doy=time.doy)],
337+
EphemerisType.ULTRA_RAPID_ORBIT: ['COD0OPSULT_{yyyy}{doy:03d}{hh}00_02D_05M_ORB.SP3'.format(yyyy=time.year, doy=time.doy, hh=hour) \
363338
for hour in ['18', '12', '06', '00']],
364339
}
365340

366-
folder_path = "%i/" % time.week
367-
filenames = []
368-
369-
# Download filenames in order of quality. Final -> Rapid -> Ultra-Rapid(newest first)
370-
if EphemerisType.FINAL_ORBIT in ephem_types and GPSTime.from_datetime(datetime.utcnow()) - time > 3 * SECS_IN_WEEK:
371-
filenames.extend(ephem_strs[EphemerisType.FINAL_ORBIT])
372-
if EphemerisType.RAPID_ORBIT in ephem_types:
373-
filenames.extend(ephem_strs[EphemerisType.RAPID_ORBIT])
374-
if EphemerisType.ULTRA_RAPID_ORBIT in ephem_types:
375-
filenames.extend(ephem_strs[EphemerisType.ULTRA_RAPID_ORBIT])
341+
# Download filenames in order of quality. Final -> Rapid -> Ultra-Rapid(newest first)
342+
if EphemerisType.FINAL_ORBIT in ephem_types and GPSTime.from_datetime(datetime.utcnow()) - time > 3 * SECS_IN_WEEK:
343+
filenames.extend(ephem_strs[EphemerisType.FINAL_ORBIT])
344+
if EphemerisType.RAPID_ORBIT in ephem_types and GPSTime.from_datetime(datetime.utcnow()) - time > 3 * SECS_IN_DAY:
345+
filenames.extend(ephem_strs[EphemerisType.RAPID_ORBIT])
346+
if EphemerisType.ULTRA_RAPID_ORBIT in ephem_types:
347+
filenames.extend(ephem_strs[EphemerisType.ULTRA_RAPID_ORBIT])
376348

377349
folder_file_names = [(folder_path, filename) for filename in filenames]
378350
ret = download_and_cache_file_return_first_success(url_bases, folder_file_names, cache_dir+'cddis_products/', compression=compression)
379-
if ret is not None:
380-
return ret
381-
382-
# fallback to COD0 Ultra Rapid Orbits
383-
return download_orbits_gps_cod0(time, cache_dir, ephem_types)
384-
385-
386-
def download_prediction_orbits_russia_src(gps_time, cache_dir):
387-
# Download single file that contains Ultra_Rapid predictions for GPS, GLONASS and other constellations
388-
t = gps_time.as_datetime()
389-
# Files exist starting at 29-01-2022
390-
if t < datetime(2022, 1, 29):
391-
return None
392-
url_bases = (
393-
mirror_url(GLONAS_IAC_BASE_URL, '/MCC/PRODUCTS/'),
394-
)
395-
folder_path = t.strftime('%y%j/ultra/')
396-
file_prefix = "Stark_1D_" + t.strftime('%y%m%d')
397-
398-
# Predictions are 24H so previous day can also be used.
399-
prev_day = (t - timedelta(days=1))
400-
file_prefix_prev = "Stark_1D_" + prev_day.strftime('%y%m%d')
401-
folder_path_prev = prev_day.strftime('%y%j/ultra/')
402-
403-
current_day = GPSTime.from_datetime(datetime(t.year, t.month, t.day))
404-
# Ultra-Orbit is published in gnss-data-alt every 10th minute past the 5,11,17,23 hour.
405-
# Predictions published are delayed by around 10 hours.
406-
# Download latest file that includes gps_time with 20 minutes margin.:
407-
if gps_time > current_day + 23.5 * SECS_IN_HR:
408-
prev_day, current_day = [], [6, 12]
409-
elif gps_time > current_day + 17.5 * SECS_IN_HR:
410-
prev_day, current_day = [], [0, 6]
411-
elif gps_time > current_day + 11.5 * SECS_IN_HR:
412-
prev_day, current_day = [18], [0]
413-
elif gps_time > current_day + 5.5 * SECS_IN_HR:
414-
prev_day, current_day = [12, 18], []
415-
else:
416-
prev_day, current_day = [6, 12], []
417-
# Example: Stark_1D_22060100.sp3
418-
folder_and_file_names = [(folder_path, file_prefix + f"{h:02}.sp3") for h in reversed(current_day)] + \
419-
[(folder_path_prev, file_prefix_prev + f"{h:02}.sp3") for h in reversed(prev_day)]
420-
return download_and_cache_file_return_first_success(url_bases, folder_and_file_names, cache_dir+'russian_products/', raise_error=True)
421-
422-
423-
def download_orbits_russia_src(time, cache_dir, ephem_types):
424-
# Orbits from russian source. Contains GPS, GLONASS, GALILEO, BEIDOU
425-
url_bases = (
426-
mirror_url(GLONAS_IAC_BASE_URL, '/MCC/PRODUCTS/'),
427-
)
428-
t = time.as_datetime()
429-
folder_paths = []
430-
current_gps_time = GPSTime.from_datetime(datetime.utcnow())
431-
filename = "Sta%i%i.sp3" % (time.week, time.dow)
432-
if EphemerisType.FINAL_ORBIT in ephem_types and current_gps_time - time > 2 * SECS_IN_WEEK:
433-
folder_paths.append(t.strftime('%y%j/final/'))
434-
if EphemerisType.RAPID_ORBIT in ephem_types:
435-
folder_paths.append(t.strftime('%y%j/rapid/'))
436-
if EphemerisType.ULTRA_RAPID_ORBIT in ephem_types:
437-
folder_paths.append(t.strftime('%y%j/ultra/'))
438-
folder_file_names = [(folder_path, filename) for folder_path in folder_paths]
439-
return download_and_cache_file_return_first_success(url_bases, folder_file_names, cache_dir+'russian_products/')
351+
return ret
440352

441353

442354
def download_ionex(time, cache_dir):
@@ -447,17 +359,16 @@ def download_ionex(time, cache_dir):
447359
folder_path = t.strftime('%Y/%j/')
448360
# Format date change
449361
if time >= GPSTime(2238, 0.0):
450-
filenames = [t.strftime('COD0OPSFIN_%Y%j0000_01D_01H_GIM.INX'),
451-
t.strftime('COD0OPSRAP_%Y%j0000_01D_01H_GIM.INX')]
452-
compression = '.gz'
362+
filenames = [t.strftime('COD0OPSFIN_%Y%j0000_01D_01H_GIM.INX.gz'),
363+
t.strftime('COD0OPSRAP_%Y%j0000_01D_01H_GIM.INX.gz'),
364+
t.strftime("c2pg%j0.%yi.Z")]
453365
else:
454-
filenames = [t.strftime("codg%j0.%yi"),
455-
t.strftime("c1pg%j0.%yi"),
456-
t.strftime("c2pg%j0.%yi")]
457-
compression = '.Z'
366+
filenames = [t.strftime("codg%j0.%yi.Z"),
367+
t.strftime("c1pg%j0.%yi.Z"),
368+
t.strftime("c2pg%j0.%yi.Z")]
458369

459370
folder_file_names = [(folder_path, f) for f in filenames]
460-
return download_and_cache_file_return_first_success(url_bases, folder_file_names, cache_dir+'ionex/', compression=compression, raise_error=True)
371+
return download_and_cache_file_return_first_success(url_bases, folder_file_names, cache_dir+'ionex/', raise_error=True)
461372

462373

463374
def download_dcb(time, cache_dir):
@@ -467,7 +378,6 @@ def download_dcb(time, cache_dir):
467378
folder_paths = []
468379
url_bases = (
469380
mirror_url(CDDIS_BASE_URL, '/gnss/products/bias/'),
470-
mirror_url(IGN_BASE_URL, '/igs/products/mgex/dcb/'),
471381
)
472382
# seem to be a lot of data missing, so try many days
473383
for time_step in [time - i * SECS_IN_DAY for i in range(14)]:

laika/ephemeris.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ def all_orbits():
4242

4343
@classmethod
4444
def from_file_name(cls, file_name: str):
45-
if "/final" in file_name or "/igs" in file_name or 'OPSFIN' in file_name:
45+
if "MGXFIN" in file_name or 'OPSFIN' in file_name:
4646
return EphemerisType.FINAL_ORBIT
47-
if "/rapid" in file_name or "/igr" in file_name or 'OPSRAP' in file_name:
47+
if 'OPSRAP' in file_name:
4848
return EphemerisType.RAPID_ORBIT
49-
if "/ultra" in file_name or "/igu" in file_name or "COD0OPSULT" in file_name or 'OPSULT' in file_name:
49+
if 'OPSULT' in file_name:
5050
return EphemerisType.ULTRA_RAPID_ORBIT
5151
raise RuntimeError(f"Ephemeris type not found in filename: {file_name}")
5252

@@ -325,8 +325,9 @@ def parse_sp3_orbits(file_names, supported_constellations, skip_until_epoch: GPS
325325

326326
def read_prn_data(data, prn, deg=16, deg_t=1):
327327
np_data_prn = np.array(data[prn], dtype=object)
328-
# Currently, don't even bother with satellites that have unhealthy times
329-
if len(np_data_prn) == 0 or (np_data_prn[:, 5] > .99).any():
328+
# > .99 is unhealthy time
329+
np_data_prn = np_data_prn[np_data_prn[:, 5] < .99]
330+
if len(np_data_prn) == 0:
330331
return []
331332
ephems = []
332333
for i in range(len(np_data_prn) - deg):

tests/test_ephemerides.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
import numpy as np
22
import unittest
33

4+
#from datetime import datetime
45
from laika.ephemeris import EphemerisType, read_prn_data
56
from laika.gps_time import GPSTime
7+
#from laika.constants import SECS_IN_DAY
68
from laika import AstroDog
79

8-
gps_times_list = [[1999, 415621.0],
9-
[2045, 455457.0],
10-
[1985, 443787.0]]
10+
gps_times_list = [[2100, 415621.0],
11+
[2200, 455457.0],
12+
[2300, 443787.0]]
1113

12-
svIds = ['G01', 'G31', 'R08']
14+
svIds = ['G07', 'G31', 'R08']
1315
gps_times = [GPSTime(*gps_time_list) for gps_time_list in gps_times_list]
1416

1517

1618
class TestAstroDog(unittest.TestCase):
1719
'''
1820
def test_nav_vs_orbit_now(self):
19-
dog_orbit = AstroDog(valid_ephem_types=EphemerisType.orbits())
21+
dog_orbit = AstroDog(valid_ephem_types=EphemerisType.all_orbits())
2022
dog_nav = AstroDog(valid_ephem_types=EphemerisType.NAV)
21-
gps_time = GPSTime.from_datetime(datetime.utcnow()) - SECS_IN_DAY*2
23+
gps_time = GPSTime.from_datetime(datetime.utcnow()) - SECS_IN_DAY*3
2224
for svId in svIds:
2325
sat_info_nav = dog_nav.get_sat_info(svId, gps_time)
26+
assert sat_info_nav is not None, f"Failed to get sat info for {svId} at {gps_time}"
2427
sat_info_orbit = dog_orbit.get_sat_info(svId, gps_time)
25-
np.testing.assert_allclose(sat_info_nav[0], sat_info_orbit[0], rtol=0, atol=5)
26-
np.testing.assert_allclose(sat_info_nav[1], sat_info_orbit[1], rtol=0, atol=.1)
28+
assert sat_info_orbit is not None
29+
np.testing.assert_allclose(sat_info_nav[0], sat_info_orbit[0], rtol=0, atol=5e2)
30+
np.testing.assert_allclose(sat_info_nav[1], sat_info_orbit[1], rtol=0, atol=1e0)
2731
np.testing.assert_allclose(sat_info_nav[2], sat_info_orbit[2], rtol=0, atol=1e-7)
28-
np.testing.assert_allclose(sat_info_nav[3], sat_info_orbit[3], rtol=0, atol=1e-11)
32+
np.testing.assert_allclose(sat_info_nav[3], sat_info_orbit[3], rtol=0, atol=1e-10)
2933
'''
3034

3135
def test_nav_vs_orbit_old(self):

tests/test_fail_caching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from laika.gps_time import GPSTime
66
from laika import AstroDog
77

8-
gps_times_list = [[1950, 415621.0]]
8+
gps_times_list = [[2350, 415621.0]]
99

10-
svIds = ['R12']
10+
svIds = ['R345'] # fake satellite id
1111
gps_times = [GPSTime(*gps_time_list) for gps_time_list in gps_times_list]
1212

1313

0 commit comments

Comments
 (0)