##// END OF EJS Templates
Bug fixed: Padding decode data with zeros at the first heights was eliminated.
Miguel Valdez -
r611:cdbd858cadba
parent child
Show More
@@ -65,7 +65,7 class AMISR:
65
65
66 def copy(self, inputObj=None):
66 def copy(self, inputObj=None):
67
67
68 if inputObj == None:
68 if inputObj is None:
69 return copy.deepcopy(self)
69 return copy.deepcopy(self)
70
70
71 for key in inputObj.__dict__.keys():
71 for key in inputObj.__dict__.keys():
@@ -619,14 +619,14 class Spectra(JROData):
619
619
620 def getFlagCspc(self):
620 def getFlagCspc(self):
621
621
622 if self.data_cspc == None:
622 if self.data_cspc is None:
623 return True
623 return True
624
624
625 return False
625 return False
626
626
627 def getFlagDc(self):
627 def getFlagDc(self):
628
628
629 if self.data_dc == None:
629 if self.data_dc is None:
630 return True
630 return True
631
631
632 return False
632 return False
@@ -668,7 +668,7 class AMISRReader(ProcessingUnit):
668 self.readNextBlock()
668 self.readNextBlock()
669
669
670
670
671 if self.datablock == None: # setear esta condicion cuando no hayan datos por leers
671 if self.datablock is None: # setear esta condicion cuando no hayan datos por leers
672 self.dataOut.flagNoData = True
672 self.dataOut.flagNoData = True
673 return 0
673 return 0
674
674
@@ -332,7 +332,7 class VoltageReader(JRODataReader, ProcessingUnit):
332
332
333 self.getFirstHeader()
333 self.getFirstHeader()
334
334
335 if self.datablock == None:
335 if self.datablock is None:
336 self.dataOut.flagNoData = True
336 self.dataOut.flagNoData = True
337 return 0
337 return 0
338
338
@@ -116,7 +116,7 class ProcessingUnit(object):
116 # if name != 'run':
116 # if name != 'run':
117 # return True
117 # return True
118
118
119 if self.dataOut == None:
119 if self.dataOut is None:
120 return False
120 return False
121
121
122 if self.dataOut.isEmpty():
122 if self.dataOut.isEmpty():
@@ -165,7 +165,7 class CorrelationProc(ProcessingUnit):
165 self.dataOut.nPoints = nPoints
165 self.dataOut.nPoints = nPoints
166 # channels = numpy.sort(list(set(list(itertools.chain.from_iterable(pairsList)))))
166 # channels = numpy.sort(list(set(list(itertools.chain.from_iterable(pairsList)))))
167
167
168 if self.buffer == None:
168 if self.buffer is None:
169
169
170 self.buffer = numpy.zeros((self.dataIn.nChannels,self.dataIn.nProfiles,self.dataIn.nHeights),dtype='complex')
170 self.buffer = numpy.zeros((self.dataIn.nChannels,self.dataIn.nProfiles,self.dataIn.nHeights),dtype='complex')
171
171
@@ -222,7 +222,7 class IncohInt4SpectraHeis(Operation):
222 data = numpy.reshape(data, (1, nChannels, nHeis))
222 data = numpy.reshape(data, (1, nChannels, nHeis))
223
223
224 #If the buffer is empty then it takes the data value
224 #If the buffer is empty then it takes the data value
225 if self.__buffer == None:
225 if self.__buffer is None:
226 self.__buffer = data
226 self.__buffer = data
227 self.__profIndex += 1
227 self.__profIndex += 1
228 return
228 return
@@ -308,7 +308,7 class IncohInt4SpectraHeis(Operation):
308
308
309 self.__lastdatatime = datatime
309 self.__lastdatatime = datatime
310
310
311 if avgdata == None:
311 if avgdata is None:
312 return None, None
312 return None, None
313
313
314 avgdatatime = self.__initime
314 avgdatatime = self.__initime
@@ -75,7 +75,7 class ParametersProc(ProcessingUnit):
75 self.nSeconds = nSeconds
75 self.nSeconds = nSeconds
76 self.nProfiles= int(numpy.floor(nSeconds/(self.dataIn.ippSeconds*self.dataIn.nCohInt)))
76 self.nProfiles= int(numpy.floor(nSeconds/(self.dataIn.ippSeconds*self.dataIn.nCohInt)))
77
77
78 if self.buffer == None:
78 if self.buffer is None:
79 self.buffer = numpy.zeros((self.dataIn.nChannels,
79 self.buffer = numpy.zeros((self.dataIn.nChannels,
80 self.nProfiles,
80 self.nProfiles,
81 self.dataIn.nHeights),
81 self.dataIn.nHeights),
@@ -174,7 +174,7 class ParametersProc(ProcessingUnit):
174 elif (self.smooth < 3): smooth = 0
174 elif (self.smooth < 3): smooth = 0
175
175
176 if (type1 == None): type1 = 0
176 if (type1 == None): type1 = 0
177 if (fwindow == None): fwindow = numpy.zeros(oldfreq.size) + 1
177 if (fwindow is None): fwindow = numpy.zeros(oldfreq.size) + 1
178 if (snrth == None): snrth = -3
178 if (snrth == None): snrth = -3
179 if (dc == None): dc = 0
179 if (dc == None): dc = 0
180 if (aliasing == None): aliasing = 0
180 if (aliasing == None): aliasing = 0
@@ -1280,7 +1280,7 class ParametersProc(ProcessingUnit):
1280 error1 = p0*numpy.nan
1280 error1 = p0*numpy.nan
1281
1281
1282 #Save
1282 #Save
1283 if self.dataOut.data_param == None:
1283 if self.dataOut.data_param is None:
1284 self.dataOut.data_param = numpy.zeros((nGroups, p0.size, nHeights))*numpy.nan
1284 self.dataOut.data_param = numpy.zeros((nGroups, p0.size, nHeights))*numpy.nan
1285 self.dataOut.data_error = numpy.zeros((nGroups, p0.size + 1, nHeights))*numpy.nan
1285 self.dataOut.data_error = numpy.zeros((nGroups, p0.size + 1, nHeights))*numpy.nan
1286
1286
@@ -1726,7 +1726,7 class WindProfiler(Operation):
1726
1726
1727 self.__isConfig = True
1727 self.__isConfig = True
1728
1728
1729 if self.__buffer == None:
1729 if self.__buffer is None:
1730 self.__buffer = dataOut.data_param
1730 self.__buffer = dataOut.data_param
1731 self.__firstdata = copy.copy(dataOut)
1731 self.__firstdata = copy.copy(dataOut)
1732
1732
@@ -1963,7 +1963,7 class PhaseCalibration(Operation):
1963
1963
1964 self.__isConfig = True
1964 self.__isConfig = True
1965
1965
1966 if self.__buffer == None:
1966 if self.__buffer is None:
1967 self.__buffer = dataOut.data_param.copy()
1967 self.__buffer = dataOut.data_param.copy()
1968
1968
1969 else:
1969 else:
@@ -130,7 +130,7 class SpectraProc(ProcessingUnit):
130 self.dataOut.nFFTPoints = nFFTPoints
130 self.dataOut.nFFTPoints = nFFTPoints
131 self.dataOut.pairsList = pairsList
131 self.dataOut.pairsList = pairsList
132
132
133 if self.buffer == None:
133 if self.buffer is None:
134 self.buffer = numpy.zeros((self.dataIn.nChannels,
134 self.buffer = numpy.zeros((self.dataIn.nChannels,
135 nProfiles,
135 nProfiles,
136 self.dataIn.nHeights),
136 self.dataIn.nHeights),
@@ -776,12 +776,12 class IncohInt(Operation):
776 if not self.__withOverapping:
776 if not self.__withOverapping:
777 self.__buffer_spc += data_spc
777 self.__buffer_spc += data_spc
778
778
779 if data_cspc == None:
779 if data_cspc is None:
780 self.__buffer_cspc = None
780 self.__buffer_cspc = None
781 else:
781 else:
782 self.__buffer_cspc += data_cspc
782 self.__buffer_cspc += data_cspc
783
783
784 if data_dc == None:
784 if data_dc is None:
785 self.__buffer_dc = None
785 self.__buffer_dc = None
786 else:
786 else:
787 self.__buffer_dc += data_dc
787 self.__buffer_dc += data_dc
@@ -798,15 +798,15 class IncohInt(Operation):
798 data_dc = numpy.reshape(data_dc, (1, -1, nHeis))
798 data_dc = numpy.reshape(data_dc, (1, -1, nHeis))
799
799
800 #If the buffer is empty then it takes the data value
800 #If the buffer is empty then it takes the data value
801 if self.__buffer_spc == None:
801 if self.__buffer_spc is None:
802 self.__buffer_spc = data_spc
802 self.__buffer_spc = data_spc
803
803
804 if data_cspc == None:
804 if data_cspc is None:
805 self.__buffer_cspc = None
805 self.__buffer_cspc = None
806 else:
806 else:
807 self.__buffer_cspc += data_cspc
807 self.__buffer_cspc += data_cspc
808
808
809 if data_dc == None:
809 if data_dc is None:
810 self.__buffer_dc = None
810 self.__buffer_dc = None
811 else:
811 else:
812 self.__buffer_dc += data_dc
812 self.__buffer_dc += data_dc
@@ -929,7 +929,7 class IncohInt(Operation):
929
929
930 self.__lastdatatime = datatime
930 self.__lastdatatime = datatime
931
931
932 if avgdata_spc == None:
932 if avgdata_spc is None:
933 return None, None, None, None
933 return None, None, None, None
934
934
935 avgdatatime = self.__initime
935 avgdatatime = self.__initime
@@ -378,7 +378,7 class CohInt(Operation):
378 data = numpy.reshape(data, (1, nChannels, nHeis))
378 data = numpy.reshape(data, (1, nChannels, nHeis))
379
379
380 #If the buffer is empty then it takes the data value
380 #If the buffer is empty then it takes the data value
381 if self.__buffer == None:
381 if self.__buffer is None:
382 self.__buffer = data
382 self.__buffer = data
383 self.__profIndex += 1
383 self.__profIndex += 1
384 return
384 return
@@ -464,7 +464,7 class CohInt(Operation):
464
464
465 self.__lastdatatime = datatime
465 self.__lastdatatime = datatime
466
466
467 if avgdata == None:
467 if avgdata is None:
468 return None, None
468 return None, None
469
469
470 avgdatatime = self.__initime
470 avgdatatime = self.__initime
@@ -608,7 +608,7 class Decoder(Operation):
608 code = self.code[self.__profIndex]
608 code = self.code[self.__profIndex]
609
609
610 for i in range(self.__nChannels):
610 for i in range(self.__nChannels):
611 self.datadecTime[i,:] = numpy.correlate(data[i,:], code, mode='same')
611 self.datadecTime[i,:] = numpy.correlate(data[i,:], code, mode='full')[self.nBaud-1:]
612
612
613 return self.datadecTime
613 return self.datadecTime
614
614
@@ -630,7 +630,7 class Decoder(Operation):
630
630
631 if not self.isConfig:
631 if not self.isConfig:
632
632
633 if code == None:
633 if code is None:
634 code = dataOut.code
634 code = dataOut.code
635 else:
635 else:
636 code = numpy.array(code).reshape(nCode,nBaud)
636 code = numpy.array(code).reshape(nCode,nBaud)
General Comments 0
You need to be logged in to leave comments. Login now