Beispiel #1
0
    def extract_altitude(self, adsb_obj):

        alt_string = adsb_obj.ADSB_BINARY_DATA[8:20]
        Q = alt_string[7]

        new_alt_string = alt_string[0:7] + alt_string[8:]

        if Q == '0':
            altitude = stuff.binstring_to_int(new_alt_string) * 100 - 1000
        else:
            altitude = stuff.binstring_to_int(new_alt_string) * 25 - 1000

        return altitude
Beispiel #2
0
 def extended_squitter_strings(self, string):
     messages = []
     for i in range(len(string) - 14):
         if (ord(string[i]) >> 3) == 17:
             crc = self.calculate_checksum(string[i:i + 14])
             if crc == stuff.binstring_to_int(
                     stuff.asciistring_to_binstring(string[i + 11:i + 14])):
                 messages.append(string[i:i + 14])
     return messages
Beispiel #3
0
    def extract_aircraft_identification(self, adsb_obj):

        csbin = adsb_obj.ADSB_BINARY_DATA[8:]

        cs = ''
        cs += self.charset[stuff.binstring_to_int(csbin[0:6])]
        cs += self.charset[stuff.binstring_to_int(csbin[6:12])]
        cs += self.charset[stuff.binstring_to_int(csbin[12:18])]
        cs += self.charset[stuff.binstring_to_int(csbin[18:24])]
        cs += self.charset[stuff.binstring_to_int(csbin[24:30])]
        cs += self.charset[stuff.binstring_to_int(csbin[30:36])]
        cs += self.charset[stuff.binstring_to_int(csbin[36:42])]
        cs += self.charset[stuff.binstring_to_int(csbin[42:48])]

        chars_to_remove = ['_', '#']
        callsign = cs.translate(None, ''.join(chars_to_remove))

        #        print 'ICAO: ' + str(adsb_obj.ICAO) + '   Callsign: ' + callsign

        return (adsb_obj.ICAO, callsign)
Beispiel #4
0
 def LONGITUDE(self):
     return stuff.binstring_to_int(self.ADSB_BINARY_DATA[39:56])
Beispiel #5
0
 def LATITUDE(self):
     return stuff.binstring_to_int(self.ADSB_BINARY_DATA[22:39])
Beispiel #6
0
 def T(self):
     return stuff.binstring_to_int(self.ADSB_BINARY_DATA[20:21])
Beispiel #7
0
 def F(self):
     return stuff.binstring_to_int(self.ADSB_BINARY_DATA[21:22])
Beispiel #8
0
 def TC(self):
     return stuff.binstring_to_int(self.ADSB_BINARY_DATA[0:5])
Beispiel #9
0
 def PARITY(self):
     return stuff.binstring_to_int(self.binstring[88:112])
Beispiel #10
0
 def ICAO(self):
     return stuff.binstring_to_int(self.binstring[8:32])
Beispiel #11
0
 def CA(self):
     return stuff.binstring_to_int(self.binstring[5:8])
Beispiel #12
0
 def DF(self):
     return stuff.binstring_to_int(self.binstring[0:5])