Fix typos

This commit is contained in:
Daniele Forsi 2021-10-09 20:55:10 +02:00
parent 83e22892ba
commit e39baf38ed
12 changed files with 20 additions and 20 deletions

View File

@ -1,7 +1,7 @@
The Python ADS-B/Mode-S Decoder 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. 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.

View File

@ -25,7 +25,7 @@ cdef unsigned char int_to_char(unsigned char i):
@cython.boundscheck(False) @cython.boundscheck(False)
@cython.overflowcheck(False) @cython.overflowcheck(False)
cpdef str hex2bin(str hexstr): 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 # num_of_bits = len(hexstr) * 4
cdef hexbytes = bytes(hexstr.encode()) cdef hexbytes = bytes(hexstr.encode())
cdef Py_ssize_t len_hexstr = PyBytes_GET_SIZE(hexbytes) cdef Py_ssize_t len_hexstr = PyBytes_GET_SIZE(hexbytes)
@ -73,7 +73,7 @@ cpdef str bin2hex(str binstr):
@cython.boundscheck(False) @cython.boundscheck(False)
cpdef unsigned char df(str msg): 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]) cdef str dfbin = hex2bin(msg[:2])
# return min(bin2int(dfbin[0:5]), 24) # return min(bin2int(dfbin[0:5]), 24)
cdef long df = bin2int(dfbin[0:5]) cdef long df = bin2int(dfbin[0:5])

View File

@ -163,10 +163,10 @@ def velocity(msg, source=False):
Args: Args:
msg (str): 28 hexdigits string msg (str): 28 hexdigits string
source (boolean): Include direction and vertical rate sources in return. Default to False. 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: 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) - Speed (kt)
- Angle (degree), either ground track or heading - Angle (degree), either ground track or heading
- Vertical rate (ft/min) - Vertical rate (ft/min)
@ -341,7 +341,7 @@ def nic_v2(msg, NICa, NICbc):
Args: Args:
msg (str): 28 hexdigits string msg (str): 28 hexdigits string
NICa (int or string): NIC supplement - A 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: Returns:
int or string: Horizontal Radius of Containment int or string: Horizontal Radius of Containment

View File

@ -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 from pyModeS import common

View File

@ -1,7 +1,7 @@
# ------------------------------------------ # ------------------------------------------
# BDS 0,6 # BDS 0,6
# ADS-B TC=5-8 # ADS-B TC=5-8
# Surface movment # Surface movement
# ------------------------------------------ # ------------------------------------------
from pyModeS import common from pyModeS import common
@ -133,7 +133,7 @@ def surface_velocity(msg, source=False):
Args: Args:
msg (str): 28 hexdigits string msg (str): 28 hexdigits string
source (boolean): Include direction and vertical rate sources in return. Default to False. 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: Returns:
int, float, int, string, [string], [string]: Four or six parameters, including: int, float, int, string, [string], [string]: Four or six parameters, including:

View File

@ -1,7 +1,7 @@
# ------------------------------------------ # ------------------------------------------
# BDS 0,8 # BDS 0,8
# ADS-B TC=1-4 # ADS-B TC=1-4
# Aircraft identitification and category # Aircraft identification and category
# ------------------------------------------ # ------------------------------------------
from pyModeS import common from pyModeS import common

View File

@ -16,7 +16,7 @@ def airborne_velocity(msg, source=False):
Args: Args:
msg (str): 28 hexdigits string msg (str): 28 hexdigits string
source (boolean): Include direction and vertical rate sources in return. Default to False. 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: Returns:
int, float, int, string, [string], [string]: Four or six parameters, including: int, float, int, string, [string], [string]: Four or six parameters, including:

View File

@ -45,7 +45,7 @@ def cap17(msg):
msg (str): 28 hexdigits string msg (str): 28 hexdigits string
Returns: Returns:
list: list of support BDS codes list: list of supported BDS codes
""" """
allbds = [ allbds = [
"05", "05",

View File

@ -142,7 +142,7 @@ def hum44(msg):
def turb44(msg): def turb44(msg):
"""Turblence. """Turbulence.
Args: Args:
msg (str): 28 hexdigits string msg (str): 28 hexdigits string

View File

@ -158,7 +158,7 @@ def vr60baro(msg):
def vr60ins(msg): def vr60ins(msg):
"""Vertical rate measurd by onbard equiments (IRS, AHRS) """Vertical rate measured by onboard equipment (IRS, AHRS)
Args: Args:
msg (str): 28 hexdigits string msg (str): 28 hexdigits string

View File

@ -5,14 +5,14 @@ from textwrap import wrap
def hex2bin(hexstr: str) -> str: 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 num_of_bits = len(hexstr) * 4
binstr = bin(int(hexstr, 16))[2:].zfill(int(num_of_bits)) binstr = bin(int(hexstr, 16))[2:].zfill(int(num_of_bits))
return binstr return binstr
def hex2int(hexstr: str) -> int: def hex2int(hexstr: str) -> int:
"""Convert a hexdecimal string to integer.""" """Convert a hexadecimal string to integer."""
return int(hexstr, 16) return int(hexstr, 16)
@ -22,7 +22,7 @@ def bin2int(binstr: str) -> int:
def bin2hex(binstr: str) -> str: 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)) return "{0:X}".format(int(binstr, 2))