commit
26ef5d3ad9
@ -1,7 +1,7 @@
|
||||
The Python ADS-B/Mode-S Decoder
|
||||
===============================
|
||||
|
||||
PyModeS is a Python library designed to decode Mode-S (including ADS-B) message. It can be imported to your python project or used as a standalone tool to view and save live traffic data.
|
||||
PyModeS is a Python library designed to decode Mode-S (including ADS-B) messages. It can be imported to your python project or used as a standalone tool to view and save live traffic data.
|
||||
|
||||
This is a project created by Junzi Sun, who works at `TU Delft <https://www.tudelft.nl/en/>`_, `Aerospace Engineering Faculty <https://www.tudelft.nl/en/ae/>`_, `CNS/ATM research group <http://cs.lr.tudelft.nl/atm/>`_. It is supported by many `contributors <https://github.com/junzis/pyModeS/graphs/contributors>`_ from different institutions.
|
||||
|
||||
|
@ -25,7 +25,7 @@ cdef unsigned char int_to_char(unsigned char i):
|
||||
@cython.boundscheck(False)
|
||||
@cython.overflowcheck(False)
|
||||
cpdef str hex2bin(str hexstr):
|
||||
"""Convert a hexdecimal string to binary string, with zero fillings."""
|
||||
"""Convert a hexadecimal string to binary string, with zero fillings."""
|
||||
# num_of_bits = len(hexstr) * 4
|
||||
cdef hexbytes = bytes(hexstr.encode())
|
||||
cdef Py_ssize_t len_hexstr = PyBytes_GET_SIZE(hexbytes)
|
||||
|
@ -109,7 +109,7 @@ def position_with_ref(msg, lat_ref, lon_ref):
|
||||
A reference position is required, which can be previously
|
||||
calculated location, ground station, or airport location.
|
||||
The function works with both airborne and surface position messages.
|
||||
The reference position shall be with in 180NM (airborne) or 45NM (surface)
|
||||
The reference position shall be within 180NM (airborne) or 45NM (surface)
|
||||
of the true position.
|
||||
|
||||
Args:
|
||||
@ -163,10 +163,10 @@ def velocity(msg, source=False):
|
||||
Args:
|
||||
msg (str): 28 hexdigits string
|
||||
source (boolean): Include direction and vertical rate sources in return. Default to False.
|
||||
If set to True, the function will return six value instead of four.
|
||||
If set to True, the function will return six values instead of four.
|
||||
|
||||
Returns:
|
||||
int, float, int, string, [string], [string]: Four or six parameters, including:
|
||||
(int, float, int, string, [string], [string]): Four or six parameters, including:
|
||||
- Speed (kt)
|
||||
- Angle (degree), either ground track or heading
|
||||
- Vertical rate (ft/min)
|
||||
@ -341,7 +341,7 @@ def nic_v2(msg, NICa, NICbc):
|
||||
Args:
|
||||
msg (str): 28 hexdigits string
|
||||
NICa (int or string): NIC supplement - A
|
||||
NICbc (int or srting): NIC supplement - B or C
|
||||
NICbc (int or string): NIC supplement - B or C
|
||||
|
||||
Returns:
|
||||
int or string: Horizontal Radius of Containment
|
||||
|
@ -1,5 +1,5 @@
|
||||
"""
|
||||
Decode all-call reply messages, with dowlink format 11
|
||||
Decode all-call reply messages, with downlink format 11
|
||||
"""
|
||||
|
||||
from pyModeS import common
|
||||
|
@ -82,7 +82,7 @@ def airborne_position_with_ref(msg, lat_ref, lon_ref):
|
||||
"""Decode airborne position with only one message,
|
||||
knowing reference nearby location, such as previously calculated location,
|
||||
ground station, or airport location, etc. The reference position shall
|
||||
be with in 180NM of the true position.
|
||||
be within 180NM of the true position.
|
||||
|
||||
Args:
|
||||
msg (str): even message (28 hexdigits)
|
||||
|
@ -86,7 +86,7 @@ def surface_position_with_ref(msg, lat_ref, lon_ref):
|
||||
"""Decode surface position with only one message,
|
||||
knowing reference nearby location, such as previously calculated location,
|
||||
ground station, or airport location, etc. The reference position shall
|
||||
be with in 45NM of the true position.
|
||||
be within 45NM of the true position.
|
||||
|
||||
Args:
|
||||
msg (str): even message (28 hexdigits)
|
||||
@ -133,7 +133,7 @@ def surface_velocity(msg, source=False):
|
||||
Args:
|
||||
msg (str): 28 hexdigits string
|
||||
source (boolean): Include direction and vertical rate sources in return. Default to False.
|
||||
If set to True, the function will return six value instead of four.
|
||||
If set to True, the function will return six values instead of four.
|
||||
|
||||
Returns:
|
||||
int, float, int, string, [string], [string]: Four or six parameters, including:
|
||||
|
@ -1,7 +1,7 @@
|
||||
# ------------------------------------------
|
||||
# BDS 0,8
|
||||
# ADS-B TC=1-4
|
||||
# Aircraft identitification and category
|
||||
# Aircraft identification and category
|
||||
# ------------------------------------------
|
||||
|
||||
from pyModeS import common
|
||||
|
@ -16,7 +16,7 @@ def airborne_velocity(msg, source=False):
|
||||
Args:
|
||||
msg (str): 28 hexdigits string
|
||||
source (boolean): Include direction and vertical rate sources in return. Default to False.
|
||||
If set to True, the function will return six value instead of four.
|
||||
If set to True, the function will return six values instead of four.
|
||||
|
||||
Returns:
|
||||
int, float, int, string, [string], [string]: Four or six parameters, including:
|
||||
|
@ -45,7 +45,7 @@ def cap17(msg):
|
||||
msg (str): 28 hexdigits string
|
||||
|
||||
Returns:
|
||||
list: list of support BDS codes
|
||||
list: list of supported BDS codes
|
||||
"""
|
||||
allbds = [
|
||||
"05",
|
||||
|
@ -142,7 +142,7 @@ def hum44(msg):
|
||||
|
||||
|
||||
def turb44(msg):
|
||||
"""Turblence.
|
||||
"""Turbulence.
|
||||
|
||||
Args:
|
||||
msg (str): 28 hexdigits string
|
||||
|
@ -158,7 +158,7 @@ def vr60baro(msg):
|
||||
|
||||
|
||||
def vr60ins(msg):
|
||||
"""Vertical rate measurd by onbard equiments (IRS, AHRS)
|
||||
"""Vertical rate measured by onboard equipment (IRS, AHRS)
|
||||
|
||||
Args:
|
||||
msg (str): 28 hexdigits string
|
||||
|
@ -7,7 +7,7 @@ try:
|
||||
import rtlsdr
|
||||
except:
|
||||
print("------------------------------------------------------------------------")
|
||||
print("! Warining: pyrtlsdr not installed (required for using RTL-SDR devices) ")
|
||||
print("! Warning: pyrtlsdr not installed (required for using RTL-SDR devices) !")
|
||||
print("------------------------------------------------------------------------")
|
||||
|
||||
sampling_rate = 2e6
|
||||
|
@ -5,14 +5,14 @@ from textwrap import wrap
|
||||
|
||||
|
||||
def hex2bin(hexstr: str) -> str:
|
||||
"""Convert a hexdecimal string to binary string, with zero fillings."""
|
||||
"""Convert a hexadecimal string to binary string, with zero fillings."""
|
||||
num_of_bits = len(hexstr) * 4
|
||||
binstr = bin(int(hexstr, 16))[2:].zfill(int(num_of_bits))
|
||||
return binstr
|
||||
|
||||
|
||||
def hex2int(hexstr: str) -> int:
|
||||
"""Convert a hexdecimal string to integer."""
|
||||
"""Convert a hexadecimal string to integer."""
|
||||
return int(hexstr, 16)
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ def bin2int(binstr: str) -> int:
|
||||
|
||||
|
||||
def bin2hex(binstr: str) -> str:
|
||||
"""Convert a binary string to hexdecimal string."""
|
||||
"""Convert a binary string to hexadecimal string."""
|
||||
return "{0:X}".format(int(binstr, 2))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user