def _logPass(self, theF, numCh, lisBytesPerCh, sampPerCh, numFr, frPerLr): myEbs = LogiRec.EntryBlockSet() # Set entry blocks to make frame spacing 0.5 b'FEET' # Block 8 myEbs.setEntryBlock( LogiRec.EntryBlock(LogiRec.EB_TYPE_FRAME_SPACE, 4, 68, 0.5)) # Block 9 myEbs.setEntryBlock( LogiRec.EntryBlock(LogiRec.EB_TYPE_FRAME_SPACE_UNITS, 4, 65, b'FEET')) myChList = [ LisGen.Channel( LisGen.ChannelSpec(bytes('{:04d}'.format(i), 'ascii'), b'ServID', b'ServOrdN', b'FEET', 45310011, 256, lisBytesPerCh, sampPerCh, 68), LisGen.ChValsConst(fOffs=0, waveLen=4, mid=0.0, amp=1.0, numSa=1, noise=36.0), ) for i in range(numCh) ] # Start at 10,000 feet myLpg = LisGen.LogPassGen(myEbs, myChList, xStart=10000.0, xRepCode=68, xNoise=None) # DFSR theF.write(myLpg.lrBytesDFSR()) for i in range(0, numFr, frPerLr): theF.write(myLpg.lrBytes(i, frPerLr))
def _retLogPassGen(self): #print() myEbs = LogiRec.EntryBlockSet() myEbs.setEntryBlock( LogiRec.EntryBlock(LogiRec.EB_TYPE_FRAME_SIZE, 1, 66, 4 * 4)) myEbs.setEntryBlock( LogiRec.EntryBlock(LogiRec.EB_TYPE_FRAME_SPACE, 1, 66, 60)) myEbs.setEntryBlock( LogiRec.EntryBlock(LogiRec.EB_TYPE_FRAME_SPACE_UNITS, 4, 65, b'.1IN')) #print('myEbs.lisByteList()') #pprint.pprint(myEbs.lisByteList()) myLp = LisGen.LogPassGen( myEbs, # Channel list [ LisGen.Channel( LisGen.ChannelSpec(b'TEST', b'ServID', b'ServOrdN', b'FEET', 45310011, 256, 16, 4, 68), LisGen.ChValsConst(fOffs=0, waveLen=4, mid=0.0, amp=1.0, numSa=1, noise=None), ), ], xStart=10000.0 * 120, xRepCode=68, xNoise=None, ) return myLp
def logPassStd256MB(self, f): """This 'standard' file is 256MB of log data with 1024 channels, single sampled. There are 65536 frames with a frame spacing of 1/10 ft. There are 128 frames per logical record.""" numCh = 1023 lisBytesPerCh = 4 sampPerCh = 1 numFr = 64*1024 frPerLr = 128 myF = self._retStdFile(f, prLen=PhysRec.PR_MAX_LENGTH) self._writeDefaultMarkerHead(myF) myEbs = LogiRec.EntryBlockSet() # Set entry blocks to make frame spacing 12 b'.1IN' i.e. 10 frames/foot # Block 8 myEbs.setEntryBlock(LogiRec.EntryBlock(LogiRec.EB_TYPE_FRAME_SPACE, 1, 66, 12)) # Block 9 myEbs.setEntryBlock(LogiRec.EntryBlock(LogiRec.EB_TYPE_FRAME_SPACE_UNITS, 4, 65, b'.1IN')) myChList = [ LisGen.Channel( LisGen.ChannelSpec( bytes('{:04d}'.format(i), 'ascii'), b'ServID', b'ServOrdN', b'FEET', 45310011, 256, lisBytesPerCh, sampPerCh, 68 ), LisGen.ChValsConst(fOffs=0, waveLen=4, mid=0.0, amp=1.0, numSa=1, noise=12.0), ) for i in range(numCh) ] # Start at 10,000 feet i.e. 10000*120 .1IN myLpg = LisGen.LogPassGen(myEbs, myChList, xStart=10000.0*120, xRepCode=68, xNoise=None) # DFSR myF.write(myLpg.lrBytesDFSR()) for i in range(0, numFr, frPerLr): myF.write(myLpg.lrBytes(i, frPerLr)) self._writeDefaultMarkerTail(myF) return os.path.getsize(myF.fileId)