@@ -479,7 +479,7 class Spectra(JROData): | |||
|
479 | 479 | pwcode = 1 |
|
480 | 480 | if self.flagDecodeData: |
|
481 | 481 | pwcode = numpy.sum(self.code[0]**2) |
|
482 |
normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt* |
|
|
482 | normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt*pwcode | |
|
483 | 483 | |
|
484 | 484 | return normFactor |
|
485 | 485 |
@@ -1032,7 +1032,7 class JRODataWriter(JRODataIO, Operation): | |||
|
1032 | 1032 | if self.fp != None: |
|
1033 | 1033 | self.fp.close() |
|
1034 | 1034 | |
|
1035 |
timeTuple = time.localtime( self.dataOut. |
|
|
1035 | timeTuple = time.localtime( self.dataOut.utctime) | |
|
1036 | 1036 | subfolder = 'D%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) |
|
1037 | 1037 | |
|
1038 | 1038 | fullpath = os.path.join( path, subfolder ) |
@@ -1382,7 +1382,7 class VoltageReader(JRODataReader): | |||
|
1382 | 1382 | if not( self.readNextBlock() ): |
|
1383 | 1383 | return 0 |
|
1384 | 1384 | |
|
1385 |
self.dataOut.dtype = |
|
|
1385 | self.dataOut.dtype = numpy.dtype([('real','<f8'),('imag','<f8')]) #self.dtype | |
|
1386 | 1386 | |
|
1387 | 1387 | self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock |
|
1388 | 1388 | |
@@ -1966,7 +1966,7 class SpectraReader(JRODataReader): | |||
|
1966 | 1966 | #desplaza a la derecha en el eje 2 determinadas posiciones |
|
1967 | 1967 | cspc = numpy.roll( cspc, shift, axis=2 ) |
|
1968 | 1968 | |
|
1969 | self.processingHeaderObj.shif_fft = True | |
|
1969 | # self.processingHeaderObj.shif_fft = True | |
|
1970 | 1970 | |
|
1971 | 1971 | spc = numpy.transpose( spc, (0,2,1) ) |
|
1972 | 1972 | self.data_spc = spc |
@@ -2040,7 +2040,7 class SpectraReader(JRODataReader): | |||
|
2040 | 2040 | |
|
2041 | 2041 | self.dataOut.flagNoData = False |
|
2042 | 2042 | |
|
2043 |
self.dataOut.dtype = |
|
|
2043 | self.dataOut.dtype = numpy.dtype([('real','<f8'),('imag','<f8')])#self.dtype | |
|
2044 | 2044 | |
|
2045 | 2045 | # self.dataOut.nChannels = self.nRdChannels |
|
2046 | 2046 | |
@@ -2280,9 +2280,9 class SpectraWriter(JRODataWriter): | |||
|
2280 | 2280 | if self.flagIsNewFile == 0: |
|
2281 | 2281 | self.getBasicHeader() |
|
2282 | 2282 | |
|
2283 | self.data_spc = self.dataOut.data_spc | |
|
2284 | self.data_cspc = self.dataOut.data_cspc | |
|
2285 | self.data_dc = self.dataOut.data_dc | |
|
2283 | self.data_spc = self.dataOut.data_spc.copy() | |
|
2284 | self.data_cspc = self.dataOut.data_cspc.copy() | |
|
2285 | self.data_dc = self.dataOut.data_dc.copy() | |
|
2286 | 2286 | |
|
2287 | 2287 | # #self.processingHeaderObj.dataBlocksPerFile) |
|
2288 | 2288 | if self.hasAllDataInBuffer(): |
@@ -89,6 +89,7 class BasicHeader(Header): | |||
|
89 | 89 | return 1 |
|
90 | 90 | |
|
91 | 91 | def write(self, fp): |
|
92 | self.utc -= self.__LOCALTIME | |
|
92 | 93 | headerTuple = (self.size,self.version,self.dataBlock,self.utc,self.miliSecond,self.timeZone,self.dstFlag,self.errorCount) |
|
93 | 94 | header = numpy.array(headerTuple,self.struct) |
|
94 | 95 | header.tofile(fp) |
@@ -390,7 +391,7 class ProcessingHeader(Header): | |||
|
390 | 391 | if ((self.processFlags & PROCFLAG.DEFINE_PROCESS_CODE) == PROCFLAG.DEFINE_PROCESS_CODE): |
|
391 | 392 | self.nCode = int(numpy.fromfile(fp,'<u4',1)) |
|
392 | 393 | self.nBaud = int(numpy.fromfile(fp,'<u4',1)) |
|
393 |
self.code = numpy.fromfile(fp,'<f4',self.nCode*self.nBaud).reshape(self.n |
|
|
394 | self.code = numpy.fromfile(fp,'<f4',self.nCode*self.nBaud).reshape(self.nCode,self.nBaud) | |
|
394 | 395 | |
|
395 | 396 | if ((self.processFlags & PROCFLAG.SHIFT_FFT_DATA) == PROCFLAG.SHIFT_FFT_DATA): |
|
396 | 397 | self.shif_fft = True |
@@ -449,13 +450,14 class ProcessingHeader(Header): | |||
|
449 | 450 | |
|
450 | 451 | |
|
451 | 452 | if self.processFlags & PROCFLAG.DEFINE_PROCESS_CODE == PROCFLAG.DEFINE_PROCESS_CODE: |
|
452 | nCode = self.nCode #Probar con un dato que almacene codigo, hasta el momento no se hizo la prueba | |
|
453 | nCode = numpy.array([self.nCode], numpy.dtype('u4')) #Probar con un dato que almacene codigo, hasta el momento no se hizo la prueba | |
|
453 | 454 | nCode.tofile(fp) |
|
454 | 455 | |
|
455 | nBaud = self.nBaud | |
|
456 | nBaud = numpy.array([self.nBaud], numpy.dtype('u4')) | |
|
456 | 457 | nBaud.tofile(fp) |
|
457 | 458 | |
|
458 | code = self.code.reshape(nCode*nBaud) | |
|
459 | code = self.code.reshape(self.nCode*self.nBaud) | |
|
460 | code = code.astype(numpy.dtype('<f4')) | |
|
459 | 461 | code.tofile(fp) |
|
460 | 462 | |
|
461 | 463 | return 1 |
@@ -53,7 +53,7 class CrossSpectraPlot(Figure): | |||
|
53 | 53 | counter += 1 |
|
54 | 54 | |
|
55 | 55 | def run(self, dataOut, idfigure, wintitle="", pairsList=None, showprofile='True', |
|
56 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
|
56 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, normalize=True, | |
|
57 | 57 | save=False, figpath='./', figfile=None, |
|
58 | 58 | power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r'): |
|
59 | 59 | |
@@ -87,11 +87,14 class CrossSpectraPlot(Figure): | |||
|
87 | 87 | |
|
88 | 88 | if len(pairsIndexList) > 4: |
|
89 | 89 | pairsIndexList = pairsIndexList[0:4] |
|
90 | ||
|
91 | factor = 1 | |
|
92 | if normalize: | |
|
90 | 93 | factor = dataOut.normFactor |
|
91 | 94 | x = dataOut.getVelRange(1) |
|
92 | 95 | y = dataOut.getHeiRange() |
|
93 | 96 | z = dataOut.data_spc[:,:,:]/factor |
|
94 | # z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
|
97 | ||
|
95 | 98 | avg = numpy.average(z, axis=1) |
|
96 | 99 | noise = dataOut.getNoise()/factor |
|
97 | 100 | |
@@ -238,7 +241,7 class RTIPlot(Figure): | |||
|
238 | 241 | counter += 1 |
|
239 | 242 | |
|
240 | 243 | def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', |
|
241 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
|
244 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, normalize=True, | |
|
242 | 245 | timerange=None, |
|
243 | 246 | save=False, figpath='./', figfile=None): |
|
244 | 247 | |
@@ -272,6 +275,8 class RTIPlot(Figure): | |||
|
272 | 275 | |
|
273 | 276 | tmin = None |
|
274 | 277 | tmax = None |
|
278 | factor = 1 | |
|
279 | if normalize: | |
|
275 | 280 | factor = dataOut.normFactor |
|
276 | 281 | x = dataOut.getTimeRange() |
|
277 | 282 | y = dataOut.getHeiRange() |
@@ -418,7 +423,7 class SpectraPlot(Figure): | |||
|
418 | 423 | counter += 1 |
|
419 | 424 | |
|
420 | 425 | def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', |
|
421 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
|
426 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, normalize=True, | |
|
422 | 427 | save=False, figpath='./', figfile=None): |
|
423 | 428 | |
|
424 | 429 | """ |
@@ -445,6 +450,8 class SpectraPlot(Figure): | |||
|
445 | 450 | if channel not in dataOut.channelList: |
|
446 | 451 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
447 | 452 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
453 | factor = 1 | |
|
454 | if normalize: | |
|
448 | 455 | factor = dataOut.normFactor |
|
449 | 456 | x = dataOut.getVelRange(1) |
|
450 | 457 | y = dataOut.getHeiRange() |
@@ -651,7 +658,7 class ProfilePlot(Figure): | |||
|
651 | 658 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
652 | 659 | |
|
653 | 660 | def run(self, dataOut, idfigure, wintitle="", channelList=None, |
|
654 | xmin=None, xmax=None, ymin=None, ymax=None, | |
|
661 | xmin=None, xmax=None, ymin=None, ymax=None, normalize=True, | |
|
655 | 662 | save=False, figpath='./', figfile=None): |
|
656 | 663 | |
|
657 | 664 | if channelList == None: |
@@ -664,6 +671,8 class ProfilePlot(Figure): | |||
|
664 | 671 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
665 | 672 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
666 | 673 | |
|
674 | factor = 1 | |
|
675 | if normalize: | |
|
667 | 676 | factor = dataOut.normFactor |
|
668 | 677 | y = dataOut.getHeiRange() |
|
669 | 678 | x = dataOut.data_spc[channelIndexList,:,:]/factor |
@@ -954,7 +963,7 class RTIfromNoise(Figure): | |||
|
954 | 963 | |
|
955 | 964 | |
|
956 | 965 | def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', |
|
957 | xmin=None, xmax=None, ymin=None, ymax=None, | |
|
966 | xmin=None, xmax=None, ymin=None, ymax=None, normalize=True, | |
|
958 | 967 | timerange=None, |
|
959 | 968 | save=False, figpath='./', figfile=None): |
|
960 | 969 | |
@@ -975,6 +984,8 class RTIfromNoise(Figure): | |||
|
975 | 984 | tmax = None |
|
976 | 985 | x = dataOut.getTimeRange() |
|
977 | 986 | y = dataOut.getHeiRange() |
|
987 | factor = 1 | |
|
988 | if normalize: | |
|
978 | 989 | factor = dataOut.normFactor |
|
979 | 990 | noise = dataOut.getNoise()/factor |
|
980 | 991 | noisedB = 10*numpy.log10(noise) |
General Comments 0
You need to be logged in to leave comments.
Login now