Skip to content

Commit 88aecd3

Browse files
committed
CONSTANT CHANNELS
1 parent 912896c commit 88aecd3

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

laika/astro_dog.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,6 @@ def get_all_sat_info(self, time):
296296

297297
return {prn: eph.get_sat_info(time) for prn, eph in ephs.items()}
298298

299-
def get_glonass_channel(self, prn, time):
300-
nav = self.get_nav(prn, time)
301-
if nav:
302-
return nav.channel
303-
return None
304-
305299
def get_frequency(self, prn, time, signal='C1C'):
306300
if get_constellation(prn) == ConstellationId.GPS:
307301
switch = {'1': constants.GPS_L1,
@@ -315,7 +309,7 @@ def get_frequency(self, prn, time, signal='C1C'):
315309
return freq
316310
raise NotImplementedError("Dont know this GPS frequency: ", signal, prn)
317311
elif get_constellation(prn) == ConstellationId.GLONASS:
318-
n = self.get_glonass_channel(prn, time)
312+
n = constants.GLONASS_CHANNELS[prn]
319313
if n is None:
320314
return None
321315
switch = {'1': constants.GLONASS_L1 + n * constants.GLONASS_L1_DELTA,

laika/constants.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,34 @@
3232
SECS_IN_DAY = 24*SECS_IN_HR
3333
SECS_IN_WEEK = 7*SECS_IN_DAY
3434
SECS_IN_YEAR = 365*SECS_IN_DAY
35+
36+
37+
# Glonass channel have not changed between 2018 and 2025 for sats 1-24, assume constant
38+
GLONASS_CHANNELS = {
39+
"R01": 1,
40+
"R02": -4,
41+
"R03": 5,
42+
"R04": 6,
43+
"R05": 1,
44+
"R06": -4,
45+
"R07": 5,
46+
"R08": 6,
47+
"R09": -2,
48+
"R10": -7,
49+
"R11": 0,
50+
"R12": -1,
51+
"R13": -2,
52+
"R14": -7,
53+
"R15": 0,
54+
"R16": -1,
55+
"R17": 4,
56+
"R18": -3,
57+
"R19": 3,
58+
"R20": 2,
59+
"R21": 4,
60+
"R22": -3,
61+
"R23": 3,
62+
"R24": 2,
63+
"R25": None,
64+
"R26": None,
65+
}

0 commit comments

Comments
 (0)