''' $Author: murco $ $Id: JROHeaderIO.py 151 2012-10-31 19:00:51Z murco $ ''' import numpy import copy import datetime BASIC_STRUCTURE = numpy.dtype([ ('nSize',' 0: fp.seek(jumpFp) except Exception, e: print "RadarControllerHeader: " + e return 0 return 1 def write(self, fp): headerTuple = (self.size, self.expType, self.nTx, self.ipp, self.txA, self.txB, self.nWindows, self.numTaus, self.codeType, self.line6Function, self.line5Function, self.fClock, self.prePulseBefore, self.prePulserAfter, self.rangeIpp, self.rangeTxA, self.rangeTxB) header = numpy.array(headerTuple,RADAR_STRUCTURE) header.tofile(fp) #dynamic = self.dynamic #dynamic.tofile(fp) samplingWindow = self.samplingWindow samplingWindow.tofile(fp) if self.numTaus > 0: self.Taus.tofile(fp) if self.codeType !=0: nCode = numpy.array(self.nCode, ' 0: self.flag_cspc = True # except Exception, e: # print "Error ProcessingHeader: " # return 0 return 1 def write(self, fp): headerTuple = (self.size, self.dtype, self.blockSize, self.profilesPerBlock, self.dataBlocksPerFile, self.nWindows, self.processFlags, self.nCohInt, self.nIncohInt, self.totalSpectra) header = numpy.array(headerTuple,PROCESSING_STRUCTURE) header.tofile(fp) if self.nWindows != 0: sampleWindowTuple = (self.firstHeight,self.deltaHeight,self.samplesWin) samplingWindow = numpy.array(sampleWindowTuple,SAMPLING_STRUCTURE) samplingWindow.tofile(fp) if self.totalSpectra != 0: spectraComb = numpy.array([],numpy.dtype('u1')) spectraComb = self.spectraComb spectraComb.tofile(fp) # if self.processFlags & PROCFLAG.DEFINE_PROCESS_CODE == PROCFLAG.DEFINE_PROCESS_CODE: # nCode = numpy.array([self.nCode], numpy.dtype('u4')) #Probar con un dato que almacene codigo, hasta el momento no se hizo la prueba # nCode.tofile(fp) # # nBaud = numpy.array([self.nBaud], numpy.dtype('u4')) # nBaud.tofile(fp) # # code = self.code.reshape(self.nCode*self.nBaud) # code = code.astype(numpy.dtype('