##// END OF EJS Templates
update readNextUnit y minHei case equal 0
Alexander Valdez -
r1675:d3470f93cd6c
parent child
Show More
1 NO CONTENT: modified file
NO CONTENT: modified file
@@ -63,6 +63,11 class SpectraProc(ProcessingUnit):
63 self.dataOut.beam.codeList = self.dataIn.beam.codeList
63 self.dataOut.beam.codeList = self.dataIn.beam.codeList
64 self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList
64 self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList
65 self.dataOut.beam.zenithList = self.dataIn.beam.zenithList
65 self.dataOut.beam.zenithList = self.dataIn.beam.zenithList
66 self.dataOut.runNextUnit = self.dataIn.runNextUnit
67 try:
68 self.dataOut.step = self.dataIn.step
69 except:
70 pass
66
71
67 def __getFft(self):
72 def __getFft(self):
68 """
73 """
@@ -116,8 +121,9 class SpectraProc(ProcessingUnit):
116 self.dataOut.blockSize = blocksize
121 self.dataOut.blockSize = blocksize
117 self.dataOut.flagShiftFFT = False
122 self.dataOut.flagShiftFFT = False
118
123
119 def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False):
124 def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False, runNextUnit = 0):
120
125
126 self.dataIn.runNextUnit = runNextUnit
121 if self.dataIn.type == "Spectra":
127 if self.dataIn.type == "Spectra":
122 self.dataOut.copy(self.dataIn)
128 self.dataOut.copy(self.dataIn)
123 if shift_fft:
129 if shift_fft:
@@ -5,8 +5,7 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecora
5 from schainpy.model.data.jrodata import Voltage,hildebrand_sekhon
5 from schainpy.model.data.jrodata import Voltage,hildebrand_sekhon
6 from schainpy.utils import log
6 from schainpy.utils import log
7 from time import time
7 from time import time
8
8 # voltage proc master
9
10
9
11 class VoltageProc(ProcessingUnit):
10 class VoltageProc(ProcessingUnit):
12
11
@@ -18,13 +17,15 class VoltageProc(ProcessingUnit):
18 self.flip = 1
17 self.flip = 1
19 self.setupReq = False
18 self.setupReq = False
20
19
21 def run(self):
20 def run(self, runNextUnit = 0):
22
21
23 if self.dataIn.type == 'AMISR':
22 if self.dataIn.type == 'AMISR':
24 self.__updateObjFromAmisrInput()
23 self.__updateObjFromAmisrInput()
25
24
26 if self.dataIn.type == 'Voltage':
25 if self.dataIn.type == 'Voltage':
27 self.dataOut.copy(self.dataIn)
26 self.dataOut.copy(self.dataIn)
27 self.dataOut.runNextUnit = runNextUnit
28
28
29
29 def __updateObjFromAmisrInput(self):
30 def __updateObjFromAmisrInput(self):
30
31
@@ -164,8 +165,12 class selectHeights(Operation):
164
165
165 self.dataOut = dataOut
166 self.dataOut = dataOut
166
167
167 if minHei and maxHei:
168 if type(minHei) == int or type(minHei) == float:
169 v_minHei= True
170 else:
171 v_minHei= False
168
172
173 if v_minHei and maxHei:
169 if (minHei < self.dataOut.heightList[0]):
174 if (minHei < self.dataOut.heightList[0]):
170 minHei = self.dataOut.heightList[0]
175 minHei = self.dataOut.heightList[0]
171
176
@@ -175,7 +180,6 class selectHeights(Operation):
175 minIndex = 0
180 minIndex = 0
176 maxIndex = 0
181 maxIndex = 0
177 heights = self.dataOut.heightList
182 heights = self.dataOut.heightList
178
179 inda = numpy.where(heights >= minHei)
183 inda = numpy.where(heights >= minHei)
180 indb = numpy.where(heights <= maxHei)
184 indb = numpy.where(heights <= maxHei)
181
185
@@ -188,7 +192,8 class selectHeights(Operation):
188 maxIndex = indb[0][-1]
192 maxIndex = indb[0][-1]
189 except:
193 except:
190 maxIndex = len(heights)
194 maxIndex = len(heights)
191
195 print(minIndex)
196 print(maxIndex)
192 self.selectHeightsByIndex(minIndex, maxIndex)
197 self.selectHeightsByIndex(minIndex, maxIndex)
193
198
194 return self.dataOut
199 return self.dataOut
@@ -211,6 +216,8 class selectHeights(Operation):
211 """
216 """
212
217
213 if self.dataOut.type == 'Voltage':
218 if self.dataOut.type == 'Voltage':
219 print(minIndex)
220 print(maxIndex)
214 if (minIndex < 0) or (minIndex > maxIndex):
221 if (minIndex < 0) or (minIndex > maxIndex):
215 raise ValueError("Height index range (%d,%d) is not valid" % (minIndex, maxIndex))
222 raise ValueError("Height index range (%d,%d) is not valid" % (minIndex, maxIndex))
216
223
@@ -647,7 +654,6 class CohInt(Operation):
647 if not self.isConfig:
654 if not self.isConfig:
648 self.setup(n=n, stride=stride, timeInterval=timeInterval, overlapping=overlapping, byblock=byblock, **kwargs)
655 self.setup(n=n, stride=stride, timeInterval=timeInterval, overlapping=overlapping, byblock=byblock, **kwargs)
649 self.isConfig = True
656 self.isConfig = True
650
651 if dataOut.flagDataAsBlock:
657 if dataOut.flagDataAsBlock:
652 """
658 """
653 Si la data es leida por bloques, dimension = [nChannels, nProfiles, nHeis]
659 Si la data es leida por bloques, dimension = [nChannels, nProfiles, nHeis]
@@ -853,7 +859,6 class Decoder(Operation):
853 dataOut.nBaud = self.nBaud
859 dataOut.nBaud = self.nBaud
854
860
855 dataOut.data = datadec
861 dataOut.data = datadec
856
857 dataOut.heightList = dataOut.heightList[0:datadec.shape[-1]]
862 dataOut.heightList = dataOut.heightList[0:datadec.shape[-1]]
858
863
859 dataOut.flagDecodeData = True #asumo q la data esta decodificada
864 dataOut.flagDecodeData = True #asumo q la data esta decodificada
@@ -865,7 +870,6 class Decoder(Operation):
865 self.__profIndex += 1
870 self.__profIndex += 1
866
871
867 return dataOut
872 return dataOut
868 # dataOut.flagDeflipData = True #asumo q la data no esta sin flip
869
873
870
874
871 class ProfileConcat(Operation):
875 class ProfileConcat(Operation):
General Comments 0
You need to be logged in to leave comments. Login now