diff --git a/schainpy/model/jrodata.py b/schainpy/model/jrodata.py index f2334f3..c8c4530 100644 --- a/schainpy/model/jrodata.py +++ b/schainpy/model/jrodata.py @@ -479,7 +479,7 @@ class Spectra(JROData): pwcode = 1 if self.flagDecodeData: pwcode = numpy.sum(self.code[0]**2) - normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt*self.windowOfFilter*pwcode + normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt*pwcode return normFactor diff --git a/schainpy/model/jrodataIO.py b/schainpy/model/jrodataIO.py index 3ac33c5..ff7b3d6 100644 --- a/schainpy/model/jrodataIO.py +++ b/schainpy/model/jrodataIO.py @@ -1032,7 +1032,7 @@ class JRODataWriter(JRODataIO, Operation): if self.fp != None: self.fp.close() - timeTuple = time.localtime( self.dataOut.dataUtcTime) + timeTuple = time.localtime( self.dataOut.utctime) subfolder = 'D%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) fullpath = os.path.join( path, subfolder ) @@ -1382,7 +1382,7 @@ class VoltageReader(JRODataReader): if not( self.readNextBlock() ): return 0 - self.dataOut.dtype = self.dtype + self.dataOut.dtype = numpy.dtype([('real',' 4: pairsIndexList = pairsIndexList[0:4] - factor = dataOut.normFactor + + factor = 1 + if normalize: + factor = dataOut.normFactor x = dataOut.getVelRange(1) y = dataOut.getHeiRange() z = dataOut.data_spc[:,:,:]/factor -# z = numpy.where(numpy.isfinite(z), z, numpy.NAN) + avg = numpy.average(z, axis=1) noise = dataOut.getNoise()/factor @@ -238,7 +241,7 @@ class RTIPlot(Figure): counter += 1 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', - xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, + xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, normalize=True, timerange=None, save=False, figpath='./', figfile=None): @@ -272,7 +275,9 @@ class RTIPlot(Figure): tmin = None tmax = None - factor = dataOut.normFactor + factor = 1 + if normalize: + factor = dataOut.normFactor x = dataOut.getTimeRange() y = dataOut.getHeiRange() @@ -418,7 +423,7 @@ class SpectraPlot(Figure): counter += 1 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', - xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, + xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, normalize=True, save=False, figpath='./', figfile=None): """ @@ -445,7 +450,9 @@ class SpectraPlot(Figure): if channel not in dataOut.channelList: raise ValueError, "Channel %d is not in dataOut.channelList" channelIndexList.append(dataOut.channelList.index(channel)) - factor = dataOut.normFactor + factor = 1 + if normalize: + factor = dataOut.normFactor x = dataOut.getVelRange(1) y = dataOut.getHeiRange() @@ -651,7 +658,7 @@ class ProfilePlot(Figure): self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) def run(self, dataOut, idfigure, wintitle="", channelList=None, - xmin=None, xmax=None, ymin=None, ymax=None, + xmin=None, xmax=None, ymin=None, ymax=None, normalize=True, save=False, figpath='./', figfile=None): if channelList == None: @@ -664,7 +671,9 @@ class ProfilePlot(Figure): raise ValueError, "Channel %d is not in dataOut.channelList" channelIndexList.append(dataOut.channelList.index(channel)) - factor = dataOut.normFactor + factor = 1 + if normalize: + factor = dataOut.normFactor y = dataOut.getHeiRange() x = dataOut.data_spc[channelIndexList,:,:]/factor x = numpy.where(numpy.isfinite(x), x, numpy.NAN) @@ -954,7 +963,7 @@ class RTIfromNoise(Figure): def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', - xmin=None, xmax=None, ymin=None, ymax=None, + xmin=None, xmax=None, ymin=None, ymax=None, normalize=True, timerange=None, save=False, figpath='./', figfile=None): @@ -975,7 +984,9 @@ class RTIfromNoise(Figure): tmax = None x = dataOut.getTimeRange() y = dataOut.getHeiRange() - factor = dataOut.normFactor + factor = 1 + if normalize: + factor = dataOut.normFactor noise = dataOut.getNoise()/factor noisedB = 10*numpy.log10(noise)