##// END OF EJS Templates
Support for VoltageReader when nTxs is >1 or <1
Miguel Valdez -
r748:0fab1290f1a0
parent child
Show More
@@ -169,7 +169,7 class VoltageReader(JRODataReader, ProcessingUnit):
169
169
170 def __hasNotDataInBuffer(self):
170 def __hasNotDataInBuffer(self):
171
171
172 if self.profileIndex >= self.processingHeaderObj.profilesPerBlock:
172 if self.profileIndex >= self.processingHeaderObj.profilesPerBlock*self.nTxs:
173 return 1
173 return 1
174
174
175 return 0
175 return 0
@@ -265,14 +265,9 class VoltageReader(JRODataReader, ProcessingUnit):
265
265
266 self.dataOut.dtype = self.dtype
266 self.dataOut.dtype = self.dtype
267
267
268 self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs
268 self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock
269
269
270 if self.processingHeaderObj.nHeights % self.nTxs != 0:
270 self.dataOut.heightList = numpy.arange(self.processingHeaderObj.nHeights) *self.processingHeaderObj.deltaHeight + self.processingHeaderObj.firstHeight
271 raise ValueError, "nTxs (%d) should be a multiple of nHeights (%d)" %(self.nTxs, self.processingHeaderObj.nHeights)
272
273 xf = self.processingHeaderObj.firstHeight + int(self.processingHeaderObj.nHeights/self.nTxs)*self.processingHeaderObj.deltaHeight
274
275 self.dataOut.heightList = numpy.arange(self.processingHeaderObj.firstHeight, xf, self.processingHeaderObj.deltaHeight)
276
271
277 self.dataOut.channelList = range(self.systemHeaderObj.nChannels)
272 self.dataOut.channelList = range(self.systemHeaderObj.nChannels)
278
273
@@ -284,6 +279,28 class VoltageReader(JRODataReader, ProcessingUnit):
284
279
285 self.dataOut.flagShiftFFT = self.processingHeaderObj.shif_fft
280 self.dataOut.flagShiftFFT = self.processingHeaderObj.shif_fft
286
281
282 def reshapeData(self):
283
284 if self.nTxs < 0:
285 return
286
287 if self.nTxs == 1:
288 return
289
290 if self.nTxs < 1 and self.processingHeaderObj.profilesPerBlock % (1./self.nTxs) != 0:
291 raise ValueError, "1./nTxs (=%f), should be a multiple of nProfiles (=%d)" %(1./self.nTxs, self.processingHeaderObj.profilesPerBlock)
292
293 if self.nTxs > 1 and self.processingHeaderObj.nHeights % self.nTxs != 0:
294 raise ValueError, "nTxs (=%d), should be a multiple of nHeights (=%d)" %(self.nTxs, self.processingHeaderObj.nHeights)
295
296 self.datablock = self.datablock.reshape((self.systemHeaderObj.nChannels, self.processingHeaderObj.profilesPerBlock*self.nTxs, self.processingHeaderObj.nHeights/self.nTxs))
297
298 self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs
299 self.dataOut.heightList = numpy.arange(self.processingHeaderObj.nHeights/self.nTxs) *self.processingHeaderObj.deltaHeight + self.processingHeaderObj.firstHeight
300 self.dataOut.radarControllerHeaderObj.ippSeconds = self.radarControllerHeaderObj.ippSeconds/self.nTxs
301
302 return
303
287 def getData(self):
304 def getData(self):
288 """
305 """
289 getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut
306 getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut
@@ -335,6 +352,8 class VoltageReader(JRODataReader, ProcessingUnit):
335 return 0
352 return 0
336
353
337 self.getFirstHeader()
354 self.getFirstHeader()
355
356 self.reshapeData()
338
357
339 if self.datablock is None:
358 if self.datablock is None:
340 self.dataOut.flagNoData = True
359 self.dataOut.flagNoData = True
@@ -349,27 +368,10 class VoltageReader(JRODataReader, ProcessingUnit):
349 blocks is increased by nTxs (nProfiles *= nTxs)
368 blocks is increased by nTxs (nProfiles *= nTxs)
350 """
369 """
351 self.dataOut.flagDataAsBlock = False
370 self.dataOut.flagDataAsBlock = False
371 self.dataOut.data = self.datablock[:,self.profileIndex,:]
372 self.dataOut.profileIndex = self.profileIndex
352
373
353 if self.nTxs == 1:
374 self.profileIndex += 1
354 self.dataOut.data = self.datablock[:,self.profileIndex,:]
355 self.dataOut.profileIndex = self.profileIndex
356
357 self.profileIndex += 1
358
359 else:
360 iniHei_ForThisTx = (self.txIndex)*int(self.processingHeaderObj.nHeights/self.nTxs)
361 endHei_ForThisTx = (self.txIndex+1)*int(self.processingHeaderObj.nHeights/self.nTxs)
362
363 # print iniHei_ForThisTx, endHei_ForThisTx
364
365 self.dataOut.data = self.datablock[:, self.profileIndex, iniHei_ForThisTx:endHei_ForThisTx]
366 self.dataOut.profileIndex = self.profileIndex*self.nTxs + self.txIndex
367
368 self.txIndex += 1
369
370 if self.txIndex == self.nTxs:
371 self.txIndex = 0
372 self.profileIndex += 1
373
375
374 else:
376 else:
375 """
377 """
@@ -377,9 +379,9 class VoltageReader(JRODataReader, ProcessingUnit):
377 """
379 """
378 self.dataOut.flagDataAsBlock = True
380 self.dataOut.flagDataAsBlock = True
379 self.dataOut.data = self.datablock
381 self.dataOut.data = self.datablock
380 self.dataOut.profileIndex = self.processingHeaderObj.profilesPerBlock
382 self.dataOut.profileIndex = self.dataOut.nProfiles - 1
381
383
382 self.profileIndex = self.processingHeaderObj.profilesPerBlock
384 self.profileIndex = self.dataOut.nProfiles
383
385
384 self.dataOut.flagNoData = False
386 self.dataOut.flagNoData = False
385
387
General Comments 0
You need to be logged in to leave comments. Login now