pull/116/head
Daniele Forsi 3 years ago
parent 83e22892ba
commit e39baf38ed

@ -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)
@ -73,7 +73,7 @@ cpdef str bin2hex(str binstr):
@cython.boundscheck(False)
cpdef unsigned char df(str msg):
"""Decode Downlink Format vaule, bits 1 to 5."""
"""Decode Downlink Format value, bits 1 to 5."""
cdef str dfbin = hex2bin(msg[:2])
# return min(bin2int(dfbin[0:5]), 24)
cdef long df = bin2int(dfbin[0:5])

@ -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

@ -1,7 +1,7 @@
# ------------------------------------------
# BDS 0,6
# ADS-B TC=5-8
# Surface movment
# Surface movement
# ------------------------------------------
from pyModeS import common
@ -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

@ -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…
Cancel
Save