From 834118a512ca2d20530db2915ce26fb5ec1a0119 2019-08-19 14:32:15 From: jespinoza Date: 2019-08-19 14:32:15 Subject: [PATCH] Correcting floats slicing bug --- diff --git a/schainpy/model/io/jroIO_voltage.py b/schainpy/model/io/jroIO_voltage.py index 2293e05..c616195 100644 --- a/schainpy/model/io/jroIO_voltage.py +++ b/schainpy/model/io/jroIO_voltage.py @@ -315,7 +315,7 @@ class VoltageReader(JRODataReader, ProcessingUnit): self.nTxs, self.processingHeaderObj.nHeights)) self.datablock = self.datablock.reshape( - (self.systemHeaderObj.nChannels, self.processingHeaderObj.profilesPerBlock * self.nTxs, self.processingHeaderObj.nHeights / self.nTxs)) + (self.systemHeaderObj.nChannels, self.processingHeaderObj.profilesPerBlock * self.nTxs, int(self.processingHeaderObj.nHeights / self.nTxs))) self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock * self.nTxs self.dataOut.heightList = numpy.arange(self.processingHeaderObj.nHeights / self.nTxs) * \ @@ -463,7 +463,6 @@ class VoltageReader(JRODataReader, ProcessingUnit): """ if self.flagNoMoreFiles: self.dataOut.flagNoData = True - print('Process finished') return 0 self.flagDiscontinuousBlock = 0 self.flagIsNewBlock = 0 @@ -492,16 +491,6 @@ class VoltageReader(JRODataReader, ProcessingUnit): self.profileIndex += 1 - # elif self.selBlocksize==None or self.selBlocksize==self.dataOut.nProfiles: - # """ - # Return all block - # """ - # self.dataOut.flagDataAsBlock = True - # self.dataOut.data = self.datablock - # self.dataOut.profileIndex = self.dataOut.nProfiles - 1 - # - # self.profileIndex = self.dataOut.nProfiles - else: """ Return a block diff --git a/schainpy/model/proc/jroproc_voltage.py b/schainpy/model/proc/jroproc_voltage.py index f72580c..8c75d37 100644 --- a/schainpy/model/proc/jroproc_voltage.py +++ b/schainpy/model/proc/jroproc_voltage.py @@ -229,8 +229,8 @@ class VoltageProc(ProcessingUnit): """ Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] """ - buffer = self.dataOut.data[:, :, 0:int(self.dataOut.nHeights-r)] - buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nProfiles,self.dataOut.nHeights/window,window) + buffer = self.dataOut.data[:, :, 0:int(self.dataOut.nHeights-r)] + buffer = buffer.reshape(self.dataOut.nChannels, self.dataOut.nProfiles, int(self.dataOut.nHeights/window), window) buffer = numpy.sum(buffer,3) else: @@ -665,8 +665,7 @@ class Decoder(Operation): def __convolutionByBlockInTime(self, data): - repetitions = self.__nProfiles / self.nCode - + repetitions = int(self.__nProfiles / self.nCode) junk = numpy.lib.stride_tricks.as_strided(self.code, (repetitions, self.code.size), (0, self.code.itemsize)) junk = junk.flatten() code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud))