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