@@ -147,7 +147,13 @@ def getL2CMessage(self):
147
147
'''
148
148
return self .l2cMessage
149
149
150
- def getBatchSignals (self , userTimeAll_s , samples , outputConfig , noiseParams , debug ):
150
+ def getBatchSignals (self ,
151
+ userTimeAll_s ,
152
+ samples ,
153
+ outputConfig ,
154
+ noiseParams ,
155
+ band ,
156
+ debug ):
151
157
'''
152
158
Generates signal samples.
153
159
@@ -159,6 +165,10 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
159
165
Array to which samples are added.
160
166
outputConfig : object
161
167
Output configuration object.
168
+ noiseParams : NoiseParameters
169
+ Noise parameters object
170
+ band : Band
171
+ Band description object.
162
172
debug : bool
163
173
Debug flag
164
174
@@ -168,9 +178,8 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
168
178
Debug information
169
179
'''
170
180
result = []
171
- if (self .l1caEnabled ):
172
- intermediateFrequency_hz = outputConfig .GPS .L1 .INTERMEDIATE_FREQUENCY_HZ
173
- frequencyIndex = outputConfig .GPS .L1 .INDEX
181
+ if (self .l1caEnabled and band == outputConfig .GPS .L1 ):
182
+ intermediateFrequency_hz = band .INTERMEDIATE_FREQUENCY_HZ
174
183
values = self .doppler .computeBatch (userTimeAll_s ,
175
184
self .amplitude ,
176
185
noiseParams ,
@@ -180,14 +189,13 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
180
189
self .l1caCode ,
181
190
outputConfig ,
182
191
debug )
183
- numpy .add (samples [frequencyIndex ],
192
+ numpy .add (samples [band . INDEX ],
184
193
values [0 ],
185
- out = samples [frequencyIndex ])
194
+ out = samples [band . INDEX ])
186
195
debugData = {'type' : "GPSL1" , 'doppler' : values [1 ]}
187
196
result .append (debugData )
188
- if (self .l2cEnabled ):
189
- intermediateFrequency_hz = outputConfig .GPS .L2 .INTERMEDIATE_FREQUENCY_HZ
190
- frequencyIndex = outputConfig .GPS .L2 .INDEX
197
+ if (self .l2cEnabled and band == outputConfig .GPS .L2 ):
198
+ intermediateFrequency_hz = band .INTERMEDIATE_FREQUENCY_HZ
191
199
values = self .doppler .computeBatch (userTimeAll_s ,
192
200
self .amplitude ,
193
201
noiseParams ,
@@ -197,21 +205,21 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
197
205
self .l2cCode ,
198
206
outputConfig ,
199
207
debug )
200
- numpy .add (samples [frequencyIndex ],
208
+ numpy .add (samples [band . INDEX ],
201
209
values [0 ],
202
- out = samples [frequencyIndex ])
210
+ out = samples [band . INDEX ])
203
211
debugData = {'type' : "GPSL2" , 'doppler' : values [1 ]}
204
212
result .append (debugData )
205
213
return result
206
214
207
- def isBandEnabled (self , bandIndex , outputConfig ):
215
+ def isBandEnabled (self , band , outputConfig ):
208
216
'''
209
217
Checks if particular band is supported and enabled.
210
218
211
219
Parameters
212
220
----------
213
- bandIndex : int
214
- Signal band index
221
+ band : Band
222
+ Band description object.
215
223
outputConfig : object
216
224
Output configuration
217
225
@@ -220,9 +228,9 @@ def isBandEnabled(self, bandIndex, outputConfig):
220
228
True, if the band is supported and enabled; False otherwise.
221
229
'''
222
230
result = None
223
- if bandIndex == outputConfig .GPS .L1 . INDEX :
231
+ if band == outputConfig .GPS .L1 :
224
232
result = self .isL1CAEnabled ()
225
- elif bandIndex == outputConfig .GPS .L2 . INDEX :
233
+ elif band == outputConfig .GPS .L2 :
226
234
result = self .isL2CEnabled ()
227
235
else :
228
236
result = False
0 commit comments