@@ -58,14 +58,14 class BasicHeader(Header): | |||||
58 | def read(self, fp): |
|
58 | def read(self, fp): | |
59 | try: |
|
59 | try: | |
60 | header = numpy.fromfile(fp, self.struct,1) |
|
60 | header = numpy.fromfile(fp, self.struct,1) | |
61 | self.size = header['nSize'][0] |
|
61 | self.size = int(header['nSize'][0]) | |
62 | self.version = header['nVersion'][0] |
|
62 | self.version = int(header['nVersion'][0]) | |
63 | self.dataBlock = header['nDataBlockId'][0] |
|
63 | self.dataBlock = int(header['nDataBlockId'][0]) | |
64 | self.utc = header['nUtime'][0] |
|
64 | self.utc = int(header['nUtime'][0]) | |
65 | self.miliSecond = header['nMilsec'][0] |
|
65 | self.miliSecond = int(header['nMilsec'][0]) | |
66 | self.timeZone = header['nTimezone'][0] |
|
66 | self.timeZone = int(header['nTimezone'][0]) | |
67 | self.dstFlag = header['nDstflag'][0] |
|
67 | self.dstFlag = int(header['nDstflag'][0]) | |
68 | self.errorCount = header['nErrorCount'][0] |
|
68 | self.errorCount = int(header['nErrorCount'][0]) | |
69 | except: |
|
69 | except: | |
70 | return 0 |
|
70 | return 0 | |
71 |
|
71 | |||
@@ -206,20 +206,20 class RadarControllerHeader(Header): | |||||
206 | try: |
|
206 | try: | |
207 | startFp = fp.tell() |
|
207 | startFp = fp.tell() | |
208 | header = numpy.fromfile(fp,self.struct,1) |
|
208 | header = numpy.fromfile(fp,self.struct,1) | |
209 | self.size = header['nSize'][0] |
|
209 | self.size = int(header['nSize'][0]) | |
210 | self.expType = header['nExpType'][0] |
|
210 | self.expType = int(header['nExpType'][0]) | |
211 | self.nTx = header['nNTx'][0] |
|
211 | self.nTx = int(header['nNTx'][0]) | |
212 | self.ipp = header['fIpp'][0] |
|
212 | self.ipp = float(header['fIpp'][0]) | |
213 | self.txA = header['fTxA'][0] |
|
213 | self.txA = float(header['fTxA'][0]) | |
214 | self.txB = header['fTxB'][0] |
|
214 | self.txB = float(header['fTxB'][0]) | |
215 | self.nWindows = header['nNumWindows'][0] |
|
215 | self.nWindows = int(header['nNumWindows'][0]) | |
216 | self.numTaus = header['nNumTaus'][0] |
|
216 | self.numTaus = int(header['nNumTaus'][0]) | |
217 | self.codeType = header['nCodeType'][0] |
|
217 | self.codeType = int(header['nCodeType'][0]) | |
218 | self.line6Function = header['nLine6Function'][0] |
|
218 | self.line6Function = int(header['nLine6Function'][0]) | |
219 | self.line5Function = header['nLine5Function'][0] |
|
219 | self.line5Function = int(header['nLine5Function'][0]) | |
220 | self.fClock = header['fClock'][0] |
|
220 | self.fClock = float(header['fClock'][0]) | |
221 | self.prePulseBefore = header['nPrePulseBefore'][0] |
|
221 | self.prePulseBefore = int(header['nPrePulseBefore'][0]) | |
222 | self.prePulserAfter = header['nPrePulseAfter'][0] |
|
222 | self.prePulserAfter = int(header['nPrePulseAfter'][0]) | |
223 | self.rangeIpp = header['sRangeIPP'][0] |
|
223 | self.rangeIpp = header['sRangeIPP'][0] | |
224 | self.rangeTxA = header['sRangeTxA'][0] |
|
224 | self.rangeTxA = header['sRangeTxA'][0] | |
225 | self.rangeTxB = header['sRangeTxB'][0] |
|
225 | self.rangeTxB = header['sRangeTxB'][0] | |
@@ -231,7 +231,7 class RadarControllerHeader(Header): | |||||
231 | fp.seek(backFp) |
|
231 | fp.seek(backFp) | |
232 |
|
232 | |||
233 | self.samplingWindow = numpy.fromfile(fp,self.samplingWindowStruct,self.nWindows) |
|
233 | self.samplingWindow = numpy.fromfile(fp,self.samplingWindowStruct,self.nWindows) | |
234 | self.nHeights = numpy.sum(self.samplingWindow['nsa']) |
|
234 | self.nHeights = int(numpy.sum(self.samplingWindow['nsa'])) | |
235 | self.firstHeight = self.samplingWindow['h0'] |
|
235 | self.firstHeight = self.samplingWindow['h0'] | |
236 | self.deltaHeight = self.samplingWindow['dh'] |
|
236 | self.deltaHeight = self.samplingWindow['dh'] | |
237 | self.samplesWin = self.samplingWindow['nsa'] |
|
237 | self.samplesWin = self.samplingWindow['nsa'] | |
@@ -239,8 +239,8 class RadarControllerHeader(Header): | |||||
239 | self.Taus = numpy.fromfile(fp,'<f4',self.numTaus) |
|
239 | self.Taus = numpy.fromfile(fp,'<f4',self.numTaus) | |
240 |
|
240 | |||
241 | if self.codeType != 0: |
|
241 | if self.codeType != 0: | |
242 | self.nCode = numpy.fromfile(fp,'<u4',1) |
|
242 | self.nCode = int(numpy.fromfile(fp,'<u4',1)) | |
243 | self.nBaud = numpy.fromfile(fp,'<u4',1) |
|
243 | self.nBaud = int(numpy.fromfile(fp,'<u4',1)) | |
244 | self.code = numpy.empty([self.nCode,self.nBaud],dtype='u1') |
|
244 | self.code = numpy.empty([self.nCode,self.nBaud],dtype='u1') | |
245 | tempList = [] |
|
245 | tempList = [] | |
246 | for ic in range(self.nCode): |
|
246 | for ic in range(self.nCode): | |
@@ -350,26 +350,26 class ProcessingHeader(Header): | |||||
350 | def read(self, fp): |
|
350 | def read(self, fp): | |
351 | try: |
|
351 | try: | |
352 | header = numpy.fromfile(fp,self.struct,1) |
|
352 | header = numpy.fromfile(fp,self.struct,1) | |
353 | self.size = header['nSize'][0] |
|
353 | self.size = int(header['nSize'][0]) | |
354 | self.dtype = header['nDataType'][0] |
|
354 | self.dtype = int(header['nDataType'][0]) | |
355 | self.blockSize = header['nSizeOfDataBlock'][0] |
|
355 | self.blockSize = int(header['nSizeOfDataBlock'][0]) | |
356 | self.profilesPerBlock = header['nProfilesperBlock'][0] |
|
356 | self.profilesPerBlock = int(header['nProfilesperBlock'][0]) | |
357 | self.dataBlocksPerFile = header['nDataBlocksperFile'][0] |
|
357 | self.dataBlocksPerFile = int(header['nDataBlocksperFile'][0]) | |
358 | self.nWindows = header['nNumWindows'][0] |
|
358 | self.nWindows = int(header['nNumWindows'][0]) | |
359 | self.processFlags = header['nProcessFlags'] |
|
359 | self.processFlags = int(header['nProcessFlags']) | |
360 | self.nCohInt = header['nCoherentIntegrations'][0] |
|
360 | self.nCohInt = int(header['nCoherentIntegrations'][0]) | |
361 | self.nIncohInt = header['nIncoherentIntegrations'][0] |
|
361 | self.nIncohInt = int(header['nIncoherentIntegrations'][0]) | |
362 | self.totalSpectra = header['nTotalSpectra'][0] |
|
362 | self.totalSpectra = int(header['nTotalSpectra'][0]) | |
363 | self.samplingWindow = numpy.fromfile(fp,self.structSamplingWindow,self.nWindows) |
|
363 | self.samplingWindow = numpy.fromfile(fp,self.structSamplingWindow,self.nWindows) | |
364 | self.nHeights = numpy.sum(self.samplingWindow['nsa']) |
|
364 | self.nHeights = int(numpy.sum(self.samplingWindow['nsa'])) | |
365 | self.firstHeight = self.samplingWindow['h0'][0] |
|
365 | self.firstHeight = int(self.samplingWindow['h0'][0]) | |
366 | self.deltaHeight = self.samplingWindow['dh'][0] |
|
366 | self.deltaHeight = int(self.samplingWindow['dh'][0]) | |
367 | self.samplesWin = self.samplingWindow['nsa'] |
|
367 | self.samplesWin = self.samplingWindow['nsa'] | |
368 | self.spectraComb = numpy.fromfile(fp,'u1',2*self.totalSpectra) |
|
368 | self.spectraComb = numpy.fromfile(fp,'u1',2*self.totalSpectra) | |
369 |
|
369 | |||
370 | if ((self.processFlags & PROCFLAG.DEFINE_PROCESS_CODE) == PROCFLAG.DEFINE_PROCESS_CODE): |
|
370 | if ((self.processFlags & PROCFLAG.DEFINE_PROCESS_CODE) == PROCFLAG.DEFINE_PROCESS_CODE): | |
371 | self.nCode = numpy.fromfile(fp,'<u4',1) |
|
371 | self.nCode = int(numpy.fromfile(fp,'<u4',1)) | |
372 | self.nBaud = numpy.fromfile(fp,'<u4',1) |
|
372 | self.nBaud = int(numpy.fromfile(fp,'<u4',1)) | |
373 | self.code = numpy.fromfile(fp,'<f4',self.nCode*self.nBaud).reshape(self.nBaud,self.nCode) |
|
373 | self.code = numpy.fromfile(fp,'<f4',self.nCode*self.nBaud).reshape(self.nBaud,self.nCode) | |
374 |
|
374 | |||
375 | if ((self.processFlags & PROCFLAG.SHIFT_FFT_DATA) == PROCFLAG.SHIFT_FFT_DATA): |
|
375 | if ((self.processFlags & PROCFLAG.SHIFT_FFT_DATA) == PROCFLAG.SHIFT_FFT_DATA): |
@@ -494,7 +494,7 class SpectraProc(ProcessingUnit): | |||||
494 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
494 | self.dataOut.nCohInt = self.dataIn.nCohInt | |
495 | self.dataOut.nIncohInt = 1 |
|
495 | self.dataOut.nIncohInt = 1 | |
496 | self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
496 | self.dataOut.ippSeconds = self.dataIn.ippSeconds | |
497 |
self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints* |
|
497 | self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nConInt*self.dataOut.nIncohInt | |
498 |
|
498 | |||
499 | def __getFft(self): |
|
499 | def __getFft(self): | |
500 | """ |
|
500 | """ | |
@@ -559,7 +559,7 class SpectraProc(ProcessingUnit): | |||||
559 | if self.dataIn.type == "Voltage": |
|
559 | if self.dataIn.type == "Voltage": | |
560 |
|
560 | |||
561 | if nFFTPoints == None: |
|
561 | if nFFTPoints == None: | |
562 |
raise ValueError, "This SpectraProc. |
|
562 | raise ValueError, "This SpectraProc.init() need nFFTPoints input variable" | |
563 |
|
563 | |||
564 | if pairsList == None: |
|
564 | if pairsList == None: | |
565 | nPairs = 0 |
|
565 | nPairs = 0 |
General Comments 0
You need to be logged in to leave comments.
Login now