##// END OF EJS Templates
update readNextUnit y minHei case equal 0
Alexander Valdez -
r1675:d3470f93cd6c
parent child
Show More
@@ -293,12 +293,12 class ReadUnitConf(ProcUnitConf):
293 293 if name == None:
294 294 if 'Reader' in datatype:
295 295 name = datatype
296 datatype = name.replace('Reader','')
296 datatype = name.replace('Reader', '')
297 297 else:
298 298 name = '{}Reader'.format(datatype)
299 299 if datatype == None:
300 300 if 'Reader' in name:
301 datatype = name.replace('Reader','')
301 datatype = name.replace('Reader', '')
302 302 else:
303 303 datatype = name
304 304 name = '{}Reader'.format(name)
@@ -63,6 +63,11 class SpectraProc(ProcessingUnit):
63 63 self.dataOut.beam.codeList = self.dataIn.beam.codeList
64 64 self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList
65 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 72 def __getFft(self):
68 73 """
@@ -116,8 +121,9 class SpectraProc(ProcessingUnit):
116 121 self.dataOut.blockSize = blocksize
117 122 self.dataOut.flagShiftFFT = False
118 123
119 def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False):
120
124 def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False, runNextUnit = 0):
125
126 self.dataIn.runNextUnit = runNextUnit
121 127 if self.dataIn.type == "Spectra":
122 128 self.dataOut.copy(self.dataIn)
123 129 if shift_fft:
@@ -226,13 +232,13 class SpectraProc(ProcessingUnit):
226 232 self.dataOut.pairsList = pairs
227 233
228 234 return
229
230 def selectFFTs(self, minFFT, maxFFT):
235
236 def selectFFTs(self, minFFT, maxFFT ):
231 237 """
232 Selecciona un bloque de datos en base a un grupo de valores de puntos FFTs segun el rango
238 Selecciona un bloque de datos en base a un grupo de valores de puntos FFTs segun el rango
233 239 minFFT<= FFT <= maxFFT
234 240 """
235
241
236 242 if (minFFT > maxFFT):
237 243 raise ValueError("Error selecting heights: Height range (%d,%d) is not valid" % (minFFT, maxFFT))
238 244
@@ -262,7 +268,7 class SpectraProc(ProcessingUnit):
262 268 self.selectFFTsByIndex(minIndex, maxIndex)
263 269
264 270 return 1
265
271
266 272 def getBeaconSignal(self, tauindex=0, channelindex=0, hei_ref=None):
267 273 newheis = numpy.where(
268 274 self.dataOut.heightList > self.dataOut.radarControllerHeaderObj.Taus[tauindex])
@@ -304,7 +310,7 class SpectraProc(ProcessingUnit):
304 310
305 311 def selectFFTsByIndex(self, minIndex, maxIndex):
306 312 """
307
313
308 314 """
309 315
310 316 if (minIndex < 0) or (minIndex > maxIndex):
@@ -327,7 +333,7 class SpectraProc(ProcessingUnit):
327 333 self.dataOut.data_spc = data_spc
328 334 self.dataOut.data_cspc = data_cspc
329 335 self.dataOut.data_dc = data_dc
330
336
331 337 self.dataOut.ippSeconds = self.dataOut.ippSeconds*(self.dataOut.nFFTPoints / numpy.shape(data_cspc)[1])
332 338 self.dataOut.nFFTPoints = numpy.shape(data_cspc)[1]
333 339 self.dataOut.profilesPerBlock = numpy.shape(data_cspc)[1]
@@ -466,7 +472,7 class removeDC(Operation):
466 472 xx_inv = numpy.linalg.inv(xx)
467 473 xx_aux = xx_inv[0, :]
468 474
469 for ich in range(num_chan):
475 for ich in range(num_chan):
470 476 yy = jspectra[ich, ind_vel, :]
471 477 jspectra[ich, freq_dc, :] = numpy.dot(xx_aux, yy)
472 478
@@ -490,12 +496,12 class removeDC(Operation):
490 496 class removeInterference(Operation):
491 497
492 498 def removeInterference2(self):
493
499
494 500 cspc = self.dataOut.data_cspc
495 501 spc = self.dataOut.data_spc
496 Heights = numpy.arange(cspc.shape[2])
502 Heights = numpy.arange(cspc.shape[2])
497 503 realCspc = numpy.abs(cspc)
498
504
499 505 for i in range(cspc.shape[0]):
500 506 LinePower= numpy.sum(realCspc[i], axis=0)
501 507 Threshold = numpy.amax(LinePower)-numpy.sort(LinePower)[len(Heights)-int(len(Heights)*0.1)]
@@ -784,7 +790,7 class IncohInt(Operation):
784 790 if n is not None:
785 791 self.n = int(n)
786 792 else:
787
793
788 794 self.__integrationtime = int(timeInterval)
789 795 self.n = None
790 796 self.__byTime = True
@@ -901,7 +907,7 class IncohInt(Operation):
901 907
902 908 dataOut.data_spc = avgdata_spc
903 909 dataOut.data_cspc = avgdata_cspc
904 dataOut.data_dc = avgdata_dc
910 dataOut.data_dc = avgdata_dc
905 911 dataOut.nIncohInt *= self.n
906 912 dataOut.utctime = avgdatatime
907 913 dataOut.flagNoData = False
@@ -909,10 +915,10 class IncohInt(Operation):
909 915 return dataOut
910 916
911 917 class dopplerFlip(Operation):
912
918
913 919 def run(self, dataOut):
914 920 # arreglo 1: (num_chan, num_profiles, num_heights)
915 self.dataOut = dataOut
921 self.dataOut = dataOut
916 922 # JULIA-oblicua, indice 2
917 923 # arreglo 2: (num_profiles, num_heights)
918 924 jspectra = self.dataOut.data_spc[2]
@@ -5,8 +5,7 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecora
5 5 from schainpy.model.data.jrodata import Voltage,hildebrand_sekhon
6 6 from schainpy.utils import log
7 7 from time import time
8
9
8 # voltage proc master
10 9
11 10 class VoltageProc(ProcessingUnit):
12 11
@@ -18,13 +17,15 class VoltageProc(ProcessingUnit):
18 17 self.flip = 1
19 18 self.setupReq = False
20 19
21 def run(self):
20 def run(self, runNextUnit = 0):
22 21
23 22 if self.dataIn.type == 'AMISR':
24 23 self.__updateObjFromAmisrInput()
25 24
26 25 if self.dataIn.type == 'Voltage':
27 26 self.dataOut.copy(self.dataIn)
27 self.dataOut.runNextUnit = runNextUnit
28
28 29
29 30 def __updateObjFromAmisrInput(self):
30 31
@@ -164,8 +165,12 class selectHeights(Operation):
164 165
165 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 174 if (minHei < self.dataOut.heightList[0]):
170 175 minHei = self.dataOut.heightList[0]
171 176
@@ -175,7 +180,6 class selectHeights(Operation):
175 180 minIndex = 0
176 181 maxIndex = 0
177 182 heights = self.dataOut.heightList
178
179 183 inda = numpy.where(heights >= minHei)
180 184 indb = numpy.where(heights <= maxHei)
181 185
@@ -188,7 +192,8 class selectHeights(Operation):
188 192 maxIndex = indb[0][-1]
189 193 except:
190 194 maxIndex = len(heights)
191
195 print(minIndex)
196 print(maxIndex)
192 197 self.selectHeightsByIndex(minIndex, maxIndex)
193 198
194 199 return self.dataOut
@@ -211,6 +216,8 class selectHeights(Operation):
211 216 """
212 217
213 218 if self.dataOut.type == 'Voltage':
219 print(minIndex)
220 print(maxIndex)
214 221 if (minIndex < 0) or (minIndex > maxIndex):
215 222 raise ValueError("Height index range (%d,%d) is not valid" % (minIndex, maxIndex))
216 223
@@ -647,7 +654,6 class CohInt(Operation):
647 654 if not self.isConfig:
648 655 self.setup(n=n, stride=stride, timeInterval=timeInterval, overlapping=overlapping, byblock=byblock, **kwargs)
649 656 self.isConfig = True
650
651 657 if dataOut.flagDataAsBlock:
652 658 """
653 659 Si la data es leida por bloques, dimension = [nChannels, nProfiles, nHeis]
@@ -853,7 +859,6 class Decoder(Operation):
853 859 dataOut.nBaud = self.nBaud
854 860
855 861 dataOut.data = datadec
856
857 862 dataOut.heightList = dataOut.heightList[0:datadec.shape[-1]]
858 863
859 864 dataOut.flagDecodeData = True #asumo q la data esta decodificada
@@ -865,7 +870,6 class Decoder(Operation):
865 870 self.__profIndex += 1
866 871
867 872 return dataOut
868 # dataOut.flagDeflipData = True #asumo q la data no esta sin flip
869 873
870 874
871 875 class ProfileConcat(Operation):
@@ -1622,4 +1626,4 class PulsePairVoltage(Operation):
1622 1626 #
1623 1627 # self.__startIndex += self.__newNSamples
1624 1628 #
1625 # return
1629 # return No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now