Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 2fe69a0

Browse files
glonass: added file formats with GLO signals for acquisition
Added GLONASS-specific file formats for processing.
1 parent 8ea1d21 commit 2fe69a0

File tree

5 files changed

+137
-70
lines changed

5 files changed

+137
-70
lines changed

peregrine/analysis/tracking_loop.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from peregrine.log import default_logging_config
1919
from peregrine.tracking import Tracker
2020
from peregrine.gps_constants import L1CA, L2C
21+
from peregrine.glo_constants import GLO_L1, GLO_L2
2122
from peregrine.run import populate_peregrine_cmd_line_arguments
2223

2324

@@ -129,6 +130,8 @@ def main():
129130

130131
samples = {L1CA: {'IF': freq_profile['GPS_L1_IF']},
131132
L2C: {'IF': freq_profile['GPS_L2_IF']},
133+
GLO_L1: {'IF': freq_profile['GLO_L1_IF']},
134+
GLO_L2: {'IF': freq_profile['GLO_L2_IF']},
132135
'samples_total': -1,
133136
'sample_index': skip_samples}
134137

peregrine/defaults.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,29 @@
3434
sample_channel_GLO_L1 = 2
3535
sample_channel_GLO_L2 = 3
3636

37+
file_encoding_1bit_x1_gpsl1 = [
38+
sample_channel_GPS_L1] # GPS L1
39+
40+
file_encoding_1bit_x1_gpsl2 = [
41+
sample_channel_GPS_L2] # GPS L2
42+
43+
file_encoding_1bit_x1_glol1 = [
44+
sample_channel_GLO_L1] # GLO L1
45+
46+
file_encoding_1bit_x1_glol2 = [
47+
sample_channel_GLO_L2] # GLO L2
48+
3749
file_encoding_1bit_x2 = [
3850
sample_channel_GPS_L1, # GPS L1
3951
sample_channel_GPS_L2] # GPS L2
4052

53+
file_encoding_1bit_x2_glol1l2 = [
54+
sample_channel_GLO_L1, # GLO L1
55+
sample_channel_GLO_L2] # GLO L2
56+
57+
file_encoding_2bits = file_encoding_1bit_x1_gpsl1
4158
file_encoding_2bits_x2 = file_encoding_1bit_x2
59+
file_encoding_2bits_x2_glol1l2 = file_encoding_1bit_x2_glol1l2
4260

4361
# encoding is taken from here:
4462
# https://swiftnav.hackpad.com/MicroZed-Sample-Grabber-IFgt5DbAunD
@@ -70,35 +88,58 @@
7088
sample_channel_GPS_L1] # RF1
7189

7290
file_encoding_profile = {
91+
'piksi': file_encoding_1bit_x1_gpsl1,
92+
'piksinew': file_encoding_1bit_x1_gpsl1,
93+
'int8': file_encoding_1bit_x1_gpsl1,
94+
'c8c8': file_encoding_1bit_x2,
95+
'1bit': file_encoding_1bit_x1_gpsl1,
96+
'1bitrev': file_encoding_1bit_x1_gpsl1,
97+
'1bit_x1': file_encoding_1bit_x1_gpsl1,
98+
'1bit_x1.gpsl1': file_encoding_1bit_x1_gpsl1,
99+
'1bit_x1.gpsl2': file_encoding_1bit_x1_gpsl2,
100+
'1bit_x1.glol1': file_encoding_1bit_x1_glol1,
101+
'1bit_x1.glol2': file_encoding_1bit_x1_glol2,
73102
'1bit_x2': file_encoding_1bit_x2,
103+
'1bit_x2.gps': file_encoding_1bit_x2,
104+
'1bit_x2.glo': file_encoding_1bit_x2_glol1l2,
105+
'2bits': file_encoding_2bits,
106+
'2bits.glol1': file_encoding_1bit_x1_glol1,
107+
'2bits.glol2': file_encoding_1bit_x1_glol2,
74108
'2bits_x2': file_encoding_2bits_x2,
109+
'2bits_x2.gps': file_encoding_2bits_x2,
110+
'2bits_x2.glo': file_encoding_2bits_x2_glol1l2,
75111
'2bits_x4': file_encoding_2bits_x4}
76112

77113
# 'peregrine' frequencies profile
78114
freq_profile_peregrine = {
79115
'GPS_L1_IF': 4.092e6,
80116
'GPS_L2_IF': 4.092e6,
117+
'GLO_L1_IF': 6e6,
118+
'GLO_L2_IF': 6e6,
81119
'sampling_freq': 16.368e6}
82120

83121
# 'low_rate' frequencies profile
84122
freq_profile_low_rate = {
85123
'GPS_L1_IF': 1026375.0,
86124
'GPS_L2_IF': 7.4e5,
87125
'GLO_L1_IF': 12e5,
126+
'GLO_L2_IF': 12e5,
88127
'sampling_freq': 24.84375e5}
89128

90129
# 'normal_rate' frequencies profile
91130
freq_profile_normal_rate = {
92131
'GPS_L1_IF': 10263750.0,
93132
'GPS_L2_IF': 7.4e6,
94133
'GLO_L1_IF': 12e6,
134+
'GLO_L2_IF': 12e6,
95135
'sampling_freq': 24.84375e6}
96136

97137
# 'high_rate' frequencies profile
98138
freq_profile_high_rate = {
99139
'GPS_L1_IF': freq_profile_normal_rate['GPS_L1_IF'],
100140
'GPS_L2_IF': freq_profile_normal_rate['GPS_L2_IF'],
101141
'GLO_L1_IF': freq_profile_normal_rate['GLO_L1_IF'],
142+
'GLO_L2_IF': freq_profile_normal_rate['GLO_L2_IF'],
102143
'sampling_freq': 99.375e6}
103144

104145
freq_profile_lookup = {

peregrine/glo_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
glo_code_wavelength = glo_code_period * c
1212

1313
GLO_L1 = 'glo_l1'
14+
GLO_L2 = 'glo_l2'

peregrine/run.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from peregrine.samples import load_samples
2121
from peregrine.acquisition import Acquisition, load_acq_results,\
22-
save_acq_results
22+
save_acq_results
2323
from peregrine.navigation import navigation
2424
import peregrine.tracking as tracking
2525
from peregrine.log import default_logging_config
@@ -56,7 +56,6 @@ def __call__(self, parser, namespace, file_hnd, option_string=None):
5656
file_hnd.close()
5757

5858

59-
6059
def populate_peregrine_cmd_line_arguments(parser):
6160
if sys.stdout.isatty():
6261
progress_bar_default = 'stdout'
@@ -115,12 +114,10 @@ def populate_peregrine_cmd_line_arguments(parser):
115114
help="How many milliseconds to skip")
116115

117116
inputCtrl.add_argument("-f", "--file-format",
118-
choices=['piksi', 'int8', '1bit', '1bitrev',
119-
'1bit_x2', '2bits', '2bits_x2', '2bits_x4'],
117+
choices=defaults.file_encoding_profile.keys(),
120118
metavar='FORMAT',
121119
help="The format of the sample data file "
122-
"('piksi', 'int8', '1bit', '1bitrev', "
123-
"'1bit_x2', '2bits', '2bits_x2', '2bits_x4')")
120+
"(%s)" % defaults.file_encoding_profile.keys())
124121

125122
inputCtrl.add_argument("--ms-to-process",
126123
metavar='MS',
@@ -236,6 +233,7 @@ def main():
236233
samples = {gps.L1CA: {'IF': freq_profile['GPS_L1_IF']},
237234
gps.L2C: {'IF': freq_profile['GPS_L2_IF']},
238235
glo.GLO_L1: {'IF': freq_profile['GLO_L1_IF']},
236+
glo.GLO_L2: {'IF': freq_profile['GLO_L2_IF']},
239237
'samples_total': -1,
240238
'sample_index': skip_samples}
241239

@@ -250,22 +248,29 @@ def main():
250248
acq_results_file)
251249
sys.exit(1)
252250
else:
251+
encoding_profile = defaults.file_encoding_profile[args.file_format]
252+
253253
acq_results = []
254-
for signal in [gps.L1CA, glo.GLO_L1]:
255-
if signal == gps.L1CA:
254+
for channel in encoding_profile:
255+
if channel == defaults.sample_channel_GPS_L1:
256+
signal = gps.L1CA
256257
code_period = gps.l1ca_code_period
257258
code_len = gps.l1ca_code_length
258259
i_f = freq_profile['GPS_L1_IF']
259260
samplesPerCode = int(round(freq_profile['sampling_freq'] /
260-
(gps.l1ca_chip_rate / gps.l1ca_code_length)))
261-
else:
261+
(gps.l1ca_chip_rate / gps.l1ca_code_length)))
262+
elif channel == defaults.sample_channel_GLO_L1:
262263
if args.skip_glonass:
263264
continue
265+
signal = glo.GLO_L1
264266
code_period = glo.glo_code_period
265267
code_len = glo.glo_code_len
266268
i_f = freq_profile['GLO_L1_IF']
267269
samplesPerCode = int(round(freq_profile['sampling_freq'] /
268-
(glo.glo_chip_rate / glo.glo_code_len)))
270+
(glo.glo_chip_rate / glo.glo_code_len)))
271+
else:
272+
# No acquisition for other signals
273+
continue
269274

270275
# Get 11ms of acquisition samples for fine frequency estimation
271276
load_samples(samples=samples,

0 commit comments

Comments
 (0)