@@ -701,10 +701,10 class JRODataReader(JRODataIO, ProcessingUnit): | |||
|
701 | 701 | processingHeaderObj = ProcessingHeader() |
|
702 | 702 | |
|
703 | 703 | try: |
|
704 |
if not( basicHeaderObj.read(fp) ): raise |
|
|
705 |
if not( systemHeaderObj.read(fp) ): raise |
|
|
706 |
if not( radarControllerHeaderObj.read(fp) ): raise |
|
|
707 |
if not( processingHeaderObj.read(fp) ): raise |
|
|
704 | if not( basicHeaderObj.read(fp) ): raise IOError | |
|
705 | if not( systemHeaderObj.read(fp) ): raise IOError | |
|
706 | if not( radarControllerHeaderObj.read(fp) ): raise IOError | |
|
707 | if not( processingHeaderObj.read(fp) ): raise IOError | |
|
708 | 708 | data_type = int(numpy.log2((processingHeaderObj.processFlags & PROCFLAG.DATATYPE_MASK))-numpy.log2(PROCFLAG.DATATYPE_CHAR)) |
|
709 | 709 | |
|
710 | 710 | neededSize = processingHeaderObj.blockSize + basicHeaderObj.size |
@@ -3,7 +3,7 | |||
|
3 | 3 | $Author: murco $ |
|
4 | 4 | $Id: JROHeaderIO.py 151 2012-10-31 19:00:51Z murco $ |
|
5 | 5 | ''' |
|
6 | ||
|
6 | import sys | |
|
7 | 7 | import numpy |
|
8 | 8 | import copy |
|
9 | 9 | |
@@ -66,7 +66,9 class BasicHeader(Header): | |||
|
66 | 66 | self.timeZone = int(header['nTimezone'][0]) |
|
67 | 67 | self.dstFlag = int(header['nDstflag'][0]) |
|
68 | 68 | self.errorCount = int(header['nErrorCount'][0]) |
|
69 | except: | |
|
69 | ||
|
70 | except Exception, e: | |
|
71 | print "BasicHeader: " + e | |
|
70 | 72 | return 0 |
|
71 | 73 | |
|
72 | 74 | return 1 |
@@ -114,7 +116,9 class SystemHeader(Header): | |||
|
114 | 116 | self.nChannels = header['nNumChannels'][0] |
|
115 | 117 | self.adcResolution = header['nADCResolution'][0] |
|
116 | 118 | self.pciDioBusWidth = header['nPCDIOBusWidth'][0] |
|
117 | except: | |
|
119 | ||
|
120 | except Exception, e: | |
|
121 | print "SystemHeader: " + e | |
|
118 | 122 | return 0 |
|
119 | 123 | |
|
120 | 124 | return 1 |
@@ -244,7 +248,7 class RadarControllerHeader(Header): | |||
|
244 | 248 | self.code = numpy.empty([self.nCode,self.nBaud],dtype='u1') |
|
245 | 249 | tempList = [] |
|
246 | 250 | for ic in range(self.nCode): |
|
247 | temp = numpy.fromfile(fp,'u1',4*numpy.ceil(self.nBaud/32.)) | |
|
251 | temp = numpy.fromfile(fp,'u1',4*int(numpy.ceil(self.nBaud/32.))) | |
|
248 | 252 | tempList.append(temp) |
|
249 | 253 | self.code[ic] = numpy.unpackbits(temp[::-1])[-1*self.nBaud:] |
|
250 | 254 | self.code = 2.0*self.code - 1.0 |
@@ -259,8 +263,9 class RadarControllerHeader(Header): | |||
|
259 | 263 | jumpFp = endFp - fp.tell() |
|
260 | 264 | if jumpFp > 0: |
|
261 | 265 | fp.seek(jumpFp) |
|
262 | ||
|
263 | except: | |
|
266 | ||
|
267 | except Exception, e: | |
|
268 | print "RadarControllerHeader: " + e | |
|
264 | 269 | return 0 |
|
265 | 270 | |
|
266 | 271 | return 1 |
@@ -395,7 +400,8 class ProcessingHeader(Header): | |||
|
395 | 400 | if nPairs > 0: |
|
396 | 401 | self.flag_cspc = True |
|
397 | 402 | |
|
398 | except: | |
|
403 | except Exception, e: | |
|
404 | print "ProcessingHeader: " + e | |
|
399 | 405 | return 0 |
|
400 | 406 | |
|
401 | 407 | return 1 |
General Comments 0
You need to be logged in to leave comments.
Login now