@@ -293,12 +293,12 class ReadUnitConf(ProcUnitConf): | |||||
293 | if name == None: |
|
293 | if name == None: | |
294 | if 'Reader' in datatype: |
|
294 | if 'Reader' in datatype: | |
295 | name = datatype |
|
295 | name = datatype | |
296 | datatype = name.replace('Reader','') |
|
296 | datatype = name.replace('Reader', '') | |
297 | else: |
|
297 | else: | |
298 | name = '{}Reader'.format(datatype) |
|
298 | name = '{}Reader'.format(datatype) | |
299 | if datatype == None: |
|
299 | if datatype == None: | |
300 | if 'Reader' in name: |
|
300 | if 'Reader' in name: | |
301 | datatype = name.replace('Reader','') |
|
301 | datatype = name.replace('Reader', '') | |
302 | else: |
|
302 | else: | |
303 | datatype = name |
|
303 | datatype = name | |
304 | name = '{}Reader'.format(name) |
|
304 | name = '{}Reader'.format(name) |
@@ -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: | |
@@ -226,13 +232,13 class SpectraProc(ProcessingUnit): | |||||
226 | self.dataOut.pairsList = pairs |
|
232 | self.dataOut.pairsList = pairs | |
227 |
|
233 | |||
228 | return |
|
234 | return | |
229 |
|
235 | |||
230 | def selectFFTs(self, minFFT, maxFFT): |
|
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 | minFFT<= FFT <= maxFFT |
|
239 | minFFT<= FFT <= maxFFT | |
234 | """ |
|
240 | """ | |
235 |
|
241 | |||
236 | if (minFFT > maxFFT): |
|
242 | if (minFFT > maxFFT): | |
237 | raise ValueError("Error selecting heights: Height range (%d,%d) is not valid" % (minFFT, maxFFT)) |
|
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 | self.selectFFTsByIndex(minIndex, maxIndex) |
|
268 | self.selectFFTsByIndex(minIndex, maxIndex) | |
263 |
|
269 | |||
264 | return 1 |
|
270 | return 1 | |
265 |
|
271 | |||
266 | def getBeaconSignal(self, tauindex=0, channelindex=0, hei_ref=None): |
|
272 | def getBeaconSignal(self, tauindex=0, channelindex=0, hei_ref=None): | |
267 | newheis = numpy.where( |
|
273 | newheis = numpy.where( | |
268 | self.dataOut.heightList > self.dataOut.radarControllerHeaderObj.Taus[tauindex]) |
|
274 | self.dataOut.heightList > self.dataOut.radarControllerHeaderObj.Taus[tauindex]) | |
@@ -304,7 +310,7 class SpectraProc(ProcessingUnit): | |||||
304 |
|
310 | |||
305 | def selectFFTsByIndex(self, minIndex, maxIndex): |
|
311 | def selectFFTsByIndex(self, minIndex, maxIndex): | |
306 | """ |
|
312 | """ | |
307 |
|
313 | |||
308 | """ |
|
314 | """ | |
309 |
|
315 | |||
310 | if (minIndex < 0) or (minIndex > maxIndex): |
|
316 | if (minIndex < 0) or (minIndex > maxIndex): | |
@@ -327,7 +333,7 class SpectraProc(ProcessingUnit): | |||||
327 | self.dataOut.data_spc = data_spc |
|
333 | self.dataOut.data_spc = data_spc | |
328 | self.dataOut.data_cspc = data_cspc |
|
334 | self.dataOut.data_cspc = data_cspc | |
329 | self.dataOut.data_dc = data_dc |
|
335 | self.dataOut.data_dc = data_dc | |
330 |
|
336 | |||
331 | self.dataOut.ippSeconds = self.dataOut.ippSeconds*(self.dataOut.nFFTPoints / numpy.shape(data_cspc)[1]) |
|
337 | self.dataOut.ippSeconds = self.dataOut.ippSeconds*(self.dataOut.nFFTPoints / numpy.shape(data_cspc)[1]) | |
332 | self.dataOut.nFFTPoints = numpy.shape(data_cspc)[1] |
|
338 | self.dataOut.nFFTPoints = numpy.shape(data_cspc)[1] | |
333 | self.dataOut.profilesPerBlock = numpy.shape(data_cspc)[1] |
|
339 | self.dataOut.profilesPerBlock = numpy.shape(data_cspc)[1] | |
@@ -466,7 +472,7 class removeDC(Operation): | |||||
466 | xx_inv = numpy.linalg.inv(xx) |
|
472 | xx_inv = numpy.linalg.inv(xx) | |
467 | xx_aux = xx_inv[0, :] |
|
473 | xx_aux = xx_inv[0, :] | |
468 |
|
474 | |||
469 |
for ich in range(num_chan): |
|
475 | for ich in range(num_chan): | |
470 | yy = jspectra[ich, ind_vel, :] |
|
476 | yy = jspectra[ich, ind_vel, :] | |
471 | jspectra[ich, freq_dc, :] = numpy.dot(xx_aux, yy) |
|
477 | jspectra[ich, freq_dc, :] = numpy.dot(xx_aux, yy) | |
472 |
|
478 | |||
@@ -490,12 +496,12 class removeDC(Operation): | |||||
490 | class removeInterference(Operation): |
|
496 | class removeInterference(Operation): | |
491 |
|
497 | |||
492 | def removeInterference2(self): |
|
498 | def removeInterference2(self): | |
493 |
|
499 | |||
494 | cspc = self.dataOut.data_cspc |
|
500 | cspc = self.dataOut.data_cspc | |
495 | spc = self.dataOut.data_spc |
|
501 | spc = self.dataOut.data_spc | |
496 |
Heights = numpy.arange(cspc.shape[2]) |
|
502 | Heights = numpy.arange(cspc.shape[2]) | |
497 | realCspc = numpy.abs(cspc) |
|
503 | realCspc = numpy.abs(cspc) | |
498 |
|
504 | |||
499 | for i in range(cspc.shape[0]): |
|
505 | for i in range(cspc.shape[0]): | |
500 | LinePower= numpy.sum(realCspc[i], axis=0) |
|
506 | LinePower= numpy.sum(realCspc[i], axis=0) | |
501 | Threshold = numpy.amax(LinePower)-numpy.sort(LinePower)[len(Heights)-int(len(Heights)*0.1)] |
|
507 | Threshold = numpy.amax(LinePower)-numpy.sort(LinePower)[len(Heights)-int(len(Heights)*0.1)] | |
@@ -784,7 +790,7 class IncohInt(Operation): | |||||
784 | if n is not None: |
|
790 | if n is not None: | |
785 | self.n = int(n) |
|
791 | self.n = int(n) | |
786 | else: |
|
792 | else: | |
787 |
|
793 | |||
788 | self.__integrationtime = int(timeInterval) |
|
794 | self.__integrationtime = int(timeInterval) | |
789 | self.n = None |
|
795 | self.n = None | |
790 | self.__byTime = True |
|
796 | self.__byTime = True | |
@@ -901,7 +907,7 class IncohInt(Operation): | |||||
901 |
|
907 | |||
902 | dataOut.data_spc = avgdata_spc |
|
908 | dataOut.data_spc = avgdata_spc | |
903 | dataOut.data_cspc = avgdata_cspc |
|
909 | dataOut.data_cspc = avgdata_cspc | |
904 |
dataOut.data_dc = avgdata_dc |
|
910 | dataOut.data_dc = avgdata_dc | |
905 | dataOut.nIncohInt *= self.n |
|
911 | dataOut.nIncohInt *= self.n | |
906 | dataOut.utctime = avgdatatime |
|
912 | dataOut.utctime = avgdatatime | |
907 | dataOut.flagNoData = False |
|
913 | dataOut.flagNoData = False | |
@@ -909,10 +915,10 class IncohInt(Operation): | |||||
909 | return dataOut |
|
915 | return dataOut | |
910 |
|
916 | |||
911 | class dopplerFlip(Operation): |
|
917 | class dopplerFlip(Operation): | |
912 |
|
918 | |||
913 | def run(self, dataOut): |
|
919 | def run(self, dataOut): | |
914 | # arreglo 1: (num_chan, num_profiles, num_heights) |
|
920 | # arreglo 1: (num_chan, num_profiles, num_heights) | |
915 |
self.dataOut = dataOut |
|
921 | self.dataOut = dataOut | |
916 | # JULIA-oblicua, indice 2 |
|
922 | # JULIA-oblicua, indice 2 | |
917 | # arreglo 2: (num_profiles, num_heights) |
|
923 | # arreglo 2: (num_profiles, num_heights) | |
918 | jspectra = self.dataOut.data_spc[2] |
|
924 | jspectra = self.dataOut.data_spc[2] |
@@ -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): | |
@@ -1622,4 +1626,4 class PulsePairVoltage(Operation): | |||||
1622 | # |
|
1626 | # | |
1623 | # self.__startIndex += self.__newNSamples |
|
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