if msg0 != '' and msg1 != '': if abs(t0 - t1) < 10: decodedPositions = decoder.get_position(msg0, msg1, t0, t1) if decodedPositions != None and len(decodedPositions) > 0: points.append(decodedPositions) return (np.asarray(points)) messageCount = 0 print('Generating plane dict') f = open('Syd.txt', 'r') planeDict = {} for line in f: Time, Message = line[:-1].split(' ') isvalid = CRC.computeChecksum(Message) addr = decoder.get_icao_addr(Message) tc = decoder.get_tc(Message) if tc >= 9 and tc <= 18: rawmsg = Message if isvalid == False: isvalid, Message = CRC.correctBitError(rawmsg) ''' if isvalid==False: isvalid,Message = CRC.correct2BitError(rawmsg) ''' if isvalid == True: messageCount += 1 addr = decoder.get_icao_addr(Message) if addr not in planeDict.keys(): planeDict[addr] = [(Time, Message)]
t1=Time if msg0!='' and msg1!='': if abs(t0-t1)<10: decodedPositions = decoder.get_position(msg0, msg1, t0, t1) if decodedPositions != None and len(decodedPositions)>0: points.append(decodedPositions) return(np.asarray(points)) messageCount=0 print('Generating plane dict') f = open('Syd.txt','r') planeDict={} for line in f: Time,Message = line[:-1].split(' ') isvalid = CRC.computeChecksum(Message) addr = decoder.get_icao_addr(Message) tc = decoder.get_tc(Message) if tc>=9 and tc<=18: rawmsg=Message if isvalid==False: isvalid,Message = CRC.correctBitError(rawmsg) ''' if isvalid==False: isvalid,Message = CRC.correct2BitError(rawmsg) ''' if isvalid==True: messageCount+=1 addr = decoder.get_icao_addr(Message) if addr not in planeDict.keys():