@@ -406,9 +406,6 class DigitalRFReader(ProcessingUnit): | |||||
406 | self.__nSamples = nSamples |
|
406 | self.__nSamples = nSamples | |
407 | if self.getByBlock: |
|
407 | if self.getByBlock: | |
408 | nSamples = nSamples*nProfileBlocks |
|
408 | nSamples = nSamples*nProfileBlocks | |
409 | print('nProfileBlocks',nProfileBlocks) |
|
|||
410 | print('nSamples',nSamples) |
|
|||
411 | print("self.__nSample",self.__nSamples) |
|
|||
412 |
|
409 | |||
413 |
|
410 | |||
414 | self.__samples_to_read = int(nSamples) # FIJO: AHORA 40 |
|
411 | self.__samples_to_read = int(nSamples) # FIJO: AHORA 40 | |
@@ -568,6 +565,7 class DigitalRFReader(ProcessingUnit): | |||||
568 | return True |
|
565 | return True | |
569 |
|
566 | |||
570 | def __isBufferEmpty(self): |
|
567 | def __isBufferEmpty(self): | |
|
568 | ||||
571 | return self.__bufferIndex > self.__samples_to_read - self.__nSamples # 40960 - 40 |
|
569 | return self.__bufferIndex > self.__samples_to_read - self.__nSamples # 40960 - 40 | |
572 |
|
570 | |||
573 | def getData(self, seconds=30, nTries=5): |
|
571 | def getData(self, seconds=30, nTries=5): | |
@@ -596,7 +594,6 class DigitalRFReader(ProcessingUnit): | |||||
596 | self.__flagDiscontinuousBlock = False |
|
594 | self.__flagDiscontinuousBlock = False | |
597 |
|
595 | |||
598 | while True: |
|
596 | while True: | |
599 | #print ("q ha pasado") |
|
|||
600 | if self.__readNextBlock(): |
|
597 | if self.__readNextBlock(): | |
601 | break |
|
598 | break | |
602 | if self.__thisUnixSample > self.__endUTCSecond * self.__sample_rate: |
|
599 | if self.__thisUnixSample > self.__endUTCSecond * self.__sample_rate: | |
@@ -623,11 +620,11 class DigitalRFReader(ProcessingUnit): | |||||
623 | if not self.getByBlock: |
|
620 | if not self.getByBlock: | |
624 |
|
621 | |||
625 | #print("self.__bufferIndex",self.__bufferIndex)# este valor siempre es cero aparentemente |
|
622 | #print("self.__bufferIndex",self.__bufferIndex)# este valor siempre es cero aparentemente | |
626 |
self.dataOut.data |
|
623 | self.dataOut.data = self.__data_buffer[:, self.__bufferIndex:self.__bufferIndex + self.__nSamples] | |
627 |
self.dataOut.utctime |
|
624 | self.dataOut.utctime = ( self.__thisUnixSample + self.__bufferIndex) / self.__sample_rate | |
628 |
self.dataOut.flagNoData |
|
625 | self.dataOut.flagNoData = False | |
629 | self.dataOut.flagDiscontinuousBlock = self.__flagDiscontinuousBlock |
|
626 | self.dataOut.flagDiscontinuousBlock = self.__flagDiscontinuousBlock | |
630 |
self.dataOut.profileIndex |
|
627 | self.dataOut.profileIndex = self.profileIndex | |
631 |
|
628 | |||
632 | self.__bufferIndex += self.__nSamples |
|
629 | self.__bufferIndex += self.__nSamples | |
633 | self.profileIndex += 1 |
|
630 | self.profileIndex += 1 | |
@@ -637,13 +634,13 class DigitalRFReader(ProcessingUnit): | |||||
637 | else: |
|
634 | else: | |
638 | # ojo debo anadir el readNextBLock y el __isBufferEmpty( |
|
635 | # ojo debo anadir el readNextBLock y el __isBufferEmpty( | |
639 | self.dataOut.flagNoData = False |
|
636 | self.dataOut.flagNoData = False | |
640 | print('Lectura por bloques') |
|
|||
641 | print("self.__nSamples",self.__nSamples) |
|
|||
642 | print("self.__bufferIndex",self.__bufferIndex) |
|
|||
643 | buffer = self.__data_buffer[:,self.__bufferIndex:self.__bufferIndex + self.__samples_to_read] |
|
637 | buffer = self.__data_buffer[:,self.__bufferIndex:self.__bufferIndex + self.__samples_to_read] | |
644 | print('shape',buffer.shape) |
|
638 | buffer = buffer.reshape((self.__nChannels, self.nProfileBlocks, int(self.__samples_to_read/self.nProfileBlocks))) | |
645 | buffer = buffer.reshape((self.__nChannels,self.nProfileBlocks,int(self.__samples_to_read/self.nProfileBlocks))) |
|
639 | self.dataOut.data = buffer | |
646 | print('shape',buffer.shape) |
|
640 | self.dataOut.utctime = ( self.__thisUnixSample + self.__bufferIndex) / self.__sample_rate | |
|
641 | self.profileIndex += self.__samples_to_read | |||
|
642 | self.__bufferIndex += self.__samples_to_read | |||
|
643 | self.dataOut.flagDiscontinuousBlock = self.__flagDiscontinuousBlock | |||
647 | return True |
|
644 | return True | |
648 |
|
645 | |||
649 |
|
646 | |||
@@ -671,7 +668,7 class DigitalRFReader(ProcessingUnit): | |||||
671 |
|
668 | |||
672 | if not self.isConfig: |
|
669 | if not self.isConfig: | |
673 | self.setup(**kwargs) |
|
670 | self.setup(**kwargs) | |
674 | #self.i = self.i+1 |
|
671 | ||
675 | self.getData(seconds=self.__delay) |
|
672 | self.getData(seconds=self.__delay) | |
676 |
|
673 | |||
677 | return |
|
674 | return |
General Comments 0
You need to be logged in to leave comments.
Login now