diff --git a/schainpy/model/jrodata.py b/schainpy/model/jrodata.py index bc7de26..8f901b9 100644 --- a/schainpy/model/jrodata.py +++ b/schainpy/model/jrodata.py @@ -214,7 +214,7 @@ class JROData: datatime = [] datatime.append(self.utctime) - datatime.append(self.utctime + 2*self.timeInterval) + datatime.append(self.utctime + self.timeInterval) datatime = numpy.array(datatime) diff --git a/schainpy/model/jrodataIO.py b/schainpy/model/jrodataIO.py index 7afc4da..3e9dadd 100644 --- a/schainpy/model/jrodataIO.py +++ b/schainpy/model/jrodataIO.py @@ -825,7 +825,15 @@ class JRODataReader(JRODataIO, ProcessingUnit): def printTotalBlocks(self): print "Number of read blocks %04d" %self.nTotalBlocks - + + def printInfo(self): + + print self.basicHeaderObj.printInfo() + print self.systemHeaderObj.printInfo() + print self.radarControllerHeaderObj.printInfo() + print self.processingHeaderObj.printInfo() + + def run(self, **kwargs): if not(self.isConfig): @@ -1338,7 +1346,38 @@ class VoltageReader(JRODataReader): if not( self.readNextBlock() ): return 0 + + self.dataOut.dtype = self.dtype + + self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock + + xf = self.processingHeaderObj.firstHeight + self.processingHeaderObj.nHeights*self.processingHeaderObj.deltaHeight + + self.dataOut.heightList = numpy.arange(self.processingHeaderObj.firstHeight, xf, self.processingHeaderObj.deltaHeight) + + self.dataOut.channelList = range(self.systemHeaderObj.nChannels) + + self.dataOut.flagTimeBlock = self.flagTimeBlock + + self.dataOut.ippSeconds = self.ippSeconds + + self.dataOut.timeInterval = self.ippSeconds * self.processingHeaderObj.nCohInt + + self.dataOut.nCohInt = self.processingHeaderObj.nCohInt + self.dataOut.flagShiftFFT = False + + if self.processingHeaderObj.code != None: + self.dataOut.nCode = self.processingHeaderObj.nCode + + self.dataOut.nBaud = self.processingHeaderObj.nBaud + + self.dataOut.code = self.processingHeaderObj.code + + self.dataOut.systemHeaderObj = self.systemHeaderObj.copy() + + self.dataOut.radarControllerHeaderObj = self.radarControllerHeaderObj.copy() + # self.updateDataHeader() #data es un numpy array de 3 dmensiones (perfiles, alturas y canales) @@ -1349,53 +1388,17 @@ class VoltageReader(JRODataReader): self.dataOut.data = self.datablock[:,self.profileIndex,:] - self.dataOut.dtype = self.dtype - -# self.dataOut.nChannels = self.systemHeaderObj.nChannels - -# self.dataOut.nHeights = self.processingHeaderObj.nHeights - - self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock - - xf = self.processingHeaderObj.firstHeight + self.processingHeaderObj.nHeights*self.processingHeaderObj.deltaHeight - - self.dataOut.heightList = numpy.arange(self.processingHeaderObj.firstHeight, xf, self.processingHeaderObj.deltaHeight) - - self.dataOut.channelList = range(self.systemHeaderObj.nChannels) - -# self.dataOut.channelIndexList = range(self.systemHeaderObj.nChannels) - - self.dataOut.flagTimeBlock = self.flagTimeBlock - self.dataOut.utctime = self.basicHeaderObj.utc + self.basicHeaderObj.miliSecond/1000. + self.profileIndex * self.ippSeconds - self.dataOut.ippSeconds = self.ippSeconds - - self.dataOut.timeInterval = self.ippSeconds * self.processingHeaderObj.nCohInt - - self.dataOut.nCohInt = self.processingHeaderObj.nCohInt - - self.dataOut.flagShiftFFT = False - - if self.processingHeaderObj.code != None: - self.dataOut.nCode = self.processingHeaderObj.nCode - - self.dataOut.nBaud = self.processingHeaderObj.nBaud - - self.dataOut.code = self.processingHeaderObj.code - self.profileIndex += 1 - self.dataOut.systemHeaderObj = self.systemHeaderObj.copy() - - self.dataOut.radarControllerHeaderObj = self.radarControllerHeaderObj.copy() - self.dataOut.flagNoData = False # print self.profileIndex, self.dataOut.utctime # if self.profileIndex == 800: # a=1 - + + return self.dataOut.data diff --git a/schainpy/model/jroheaderIO.py b/schainpy/model/jroheaderIO.py index 6770bde..1e23135 100644 --- a/schainpy/model/jroheaderIO.py +++ b/schainpy/model/jroheaderIO.py @@ -20,6 +20,11 @@ class Header: def write(): pass + + def printInfo(self): + + for key in self.__dict__.keys(): + print "%s = %s" %(key, self.__dict__[key]) class BasicHeader(Header): diff --git a/schainpy/model/jroprocessing.py b/schainpy/model/jroprocessing.py index 181c5a1..a9d9c23 100644 --- a/schainpy/model/jroprocessing.py +++ b/schainpy/model/jroprocessing.py @@ -576,7 +576,7 @@ class SpectraProc(ProcessingUnit): self.dataOut.nIncohInt = 1 self.dataOut.ippSeconds = self.dataIn.ippSeconds - self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nCohInt*self.dataOut.nIncohInt + self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nIncohInt def __getFft(self): """ @@ -587,23 +587,9 @@ class SpectraProc(ProcessingUnit): self.dataOut.data_cspc self.dataOut.data_dc self.dataOut.heightList - self.dataOut.m_BasicHeader - self.dataOut.m_ProcessingHeader - self.dataOut.radarControllerHeaderObj - self.dataOut.systemHeaderObj self.profIndex self.buffer self.dataOut.flagNoData - self.dataOut.dtype - self.dataOut.nPairs - self.dataOut.nChannels - self.dataOut.nProfiles - self.dataOut.systemHeaderObj.numChannels - self.dataOut.m_ProcessingHeader.totalSpectra - self.dataOut.m_ProcessingHeader.profilesPerBlock - self.dataOut.m_ProcessingHeader.numHeights - self.dataOut.m_ProcessingHeader.spectraComb - self.dataOut.m_ProcessingHeader.shif_fft """ fft_volt = numpy.fft.fft(self.buffer,axis=1) dc = fft_volt[:,0,:]