Trees | Indices | Help |
---|
|
1 #!/usr/bin/env python 2 3 import sys, binary, ais_msg_5, aisstring 4 from BitVector import BitVector 5 6 for line in file('5.ais'): 7 fields = line.split(',')[:6] 8 if '1'!=fields[2]: # Must be the start of a sequence 9 continue 10 if len(fields[5])<39: continue 11 bv = binary.ais6tobitvec(fields[5][:39]) # Hacked for speed 12 13 #mmsi = int(bv[8:38]) 14 #name = aisstring.decode(bv[112:232]) #aisstring.unpad() 15 mmsi = ais_msg_5.decodeUserID(bv) 16 name = aisstring.unpad(ais_msg_5.decodename(bv)) 17 print mmsi,name 18
Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Tue Jun 5 11:57:51 2007 | http://epydoc.sourceforge.net |