@@ -147,7 +147,13 @@ def getL2CMessage(self):
147147 '''
148148 return self .l2cMessage
149149
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 ):
151157 '''
152158 Generates signal samples.
153159
@@ -159,6 +165,10 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
159165 Array to which samples are added.
160166 outputConfig : object
161167 Output configuration object.
168+ noiseParams : NoiseParameters
169+ Noise parameters object
170+ band : Band
171+ Band description object.
162172 debug : bool
163173 Debug flag
164174
@@ -168,9 +178,8 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
168178 Debug information
169179 '''
170180 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
174183 values = self .doppler .computeBatch (userTimeAll_s ,
175184 self .amplitude ,
176185 noiseParams ,
@@ -180,14 +189,13 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
180189 self .l1caCode ,
181190 outputConfig ,
182191 debug )
183- numpy .add (samples [frequencyIndex ],
192+ numpy .add (samples [band . INDEX ],
184193 values [0 ],
185- out = samples [frequencyIndex ])
194+ out = samples [band . INDEX ])
186195 debugData = {'type' : "GPSL1" , 'doppler' : values [1 ]}
187196 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
191199 values = self .doppler .computeBatch (userTimeAll_s ,
192200 self .amplitude ,
193201 noiseParams ,
@@ -197,21 +205,21 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
197205 self .l2cCode ,
198206 outputConfig ,
199207 debug )
200- numpy .add (samples [frequencyIndex ],
208+ numpy .add (samples [band . INDEX ],
201209 values [0 ],
202- out = samples [frequencyIndex ])
210+ out = samples [band . INDEX ])
203211 debugData = {'type' : "GPSL2" , 'doppler' : values [1 ]}
204212 result .append (debugData )
205213 return result
206214
207- def isBandEnabled (self , bandIndex , outputConfig ):
215+ def isBandEnabled (self , band , outputConfig ):
208216 '''
209217 Checks if particular band is supported and enabled.
210218
211219 Parameters
212220 ----------
213- bandIndex : int
214- Signal band index
221+ band : Band
222+ Band description object.
215223 outputConfig : object
216224 Output configuration
217225
@@ -220,9 +228,9 @@ def isBandEnabled(self, bandIndex, outputConfig):
220228 True, if the band is supported and enabled; False otherwise.
221229 '''
222230 result = None
223- if bandIndex == outputConfig .GPS .L1 . INDEX :
231+ if band == outputConfig .GPS .L1 :
224232 result = self .isL1CAEnabled ()
225- elif bandIndex == outputConfig .GPS .L2 . INDEX :
233+ elif band == outputConfig .GPS .L2 :
226234 result = self .isL2CEnabled ()
227235 else :
228236 result = False
0 commit comments