diff --git a/schainpy/model/data/jrodata.py b/schainpy/model/data/jrodata.py index 39a5287..029ad5f 100644 --- a/schainpy/model/data/jrodata.py +++ b/schainpy/model/data/jrodata.py @@ -362,6 +362,7 @@ class Voltage(JROData): data = None data_intensity = None data_velocity = None + data_specwidth = None def __init__(self): ''' Constructor @@ -1268,6 +1269,10 @@ class PlotterData(object): buffer = dataOut.data_velocity self.flagDataAsBlock = dataOut.flagDataAsBlock self.nProfiles = dataOut.nProfiles + if plot == 'pp_specwidth': + buffer = dataOut.data_specwidth + self.flagDataAsBlock = dataOut.flagDataAsBlock + self.nProfiles = dataOut.nProfiles if plot == 'spc': self.data['spc'] = buffer diff --git a/schainpy/model/io/jroIO_simulator.py b/schainpy/model/io/jroIO_simulator.py index bc2bbe1..874843f 100644 --- a/schainpy/model/io/jroIO_simulator.py +++ b/schainpy/model/io/jroIO_simulator.py @@ -32,7 +32,7 @@ class SimulatorReader(JRODataReader, ProcessingUnit): #Dyn_snCode = numpy.array([Num_Codes,Bauds]) Dyn_snCode = None Samples = 200 - channels = 5 + channels = 2 pulses = None Reference = None pulse_size = None @@ -91,12 +91,14 @@ class SimulatorReader(JRODataReader, ProcessingUnit): if (self.nReadBlocks >= self.processingHeaderObj.dataBlocksPerFile): self.nReadFiles=self.nReadFiles+1 - if self.nReadFiles ==self.nTotalReadFiles: + if self.nReadFiles > self.nTotalReadFiles: self.flagNoMoreFiles=1 raise schainpy.admin.SchainWarning('No more files to read') print('------------------- [Opening file] ------------------------------',self.nReadFiles) self.nReadBlocks = 0 + #if self.nReadBlocks==0: + # self.readFirstHeader() def __setNewBlock(self): self.setNextFile() @@ -121,6 +123,7 @@ class SimulatorReader(JRODataReader, ProcessingUnit): self.dataOut.processingHeaderObj = self.processingHeaderObj.copy() self.dataOut.systemHeaderObj = self.systemHeaderObj.copy() self.dataOut.radarControllerHeaderObj = self.radarControllerHeaderObj.copy() + self.dataOut.dtype = self.dtype self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock self.dataOut.heightList = numpy.arange(self.processingHeaderObj.nHeights) * self.processingHeaderObj.deltaHeight + self.processingHeaderObj.firstHeight @@ -144,20 +147,42 @@ class SimulatorReader(JRODataReader, ProcessingUnit): self.dataOut.useLocalTime = self.basicHeaderObj.useLocalTime self.dataOut.ippSeconds = self.radarControllerHeaderObj.ippSeconds / self.nTxs + def readFirstHeader(self): + + datatype = int(numpy.log2((self.processingHeaderObj.processFlags & + PROCFLAG.DATATYPE_MASK)) - numpy.log2(PROCFLAG.DATATYPE_CHAR)) + if datatype == 0: + datatype_str = numpy.dtype([('real', '