Merge branch 'master' of github.com:junzis/pyModeS

adsb_encoder^2
Junzi Sun 4 years ago
commit d50f05d00d

@ -1,26 +1,19 @@
The Python ADS-B/Mode-S Decoder The Python ADS-B/Mode-S Decoder
=============================== ===============================
If you find this project useful for your research, please considering cite this tool as:: 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.
@article{sun2019pymodes,
author={J. {Sun} and H. {V\^u} and J. {Ellerbroek} and J. M. {Hoekstra}},
journal={IEEE Transactions on Intelligent Transportation Systems},
title={pyModeS: Decoding Mode-S Surveillance Data for Open Air Transportation Research},
year={2019},
doi={10.1109/TITS.2019.2914770},
ISSN={1524-9050},
}
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.
Introduction Introduction
--------------------- ------------
PyModeS is a Python library designed to decode Mode-S (including ADS-B) message. It can be imported to your python project or be used as a standalone tool to view and save live traffic data.
pyModeS supports the decoding of following types of messages:
Messages with following Downlink Formats (DF) are supported: - DF4 / DF20: Altitude code
- DF5 / DF21: Identity code (squawk code)
**DF17 / DF18: Automatic Dependent Surveillance-Broadcast (ADS-B)** - DF17 / DF18: Automatic Dependent Surveillance-Broadcast (ADS-B)
- TC=1-4 / BDS 0,8: Aircraft identification and category - TC=1-4 / BDS 0,8: Aircraft identification and category
- TC=5-8 / BDS 0,6: Surface position - TC=5-8 / BDS 0,6: Surface position
@ -30,8 +23,7 @@ Messages with following Downlink Formats (DF) are supported:
- TC=29 / BDS 6,2: Target state and status information [to be implemented] - TC=29 / BDS 6,2: Target state and status information [to be implemented]
- TC=31 / BDS 6,5: Aircraft operational status [to be implemented] - TC=31 / BDS 6,5: Aircraft operational status [to be implemented]
- DF20 / DF21: Mode-S Comm-B messages
**DF20 / DF21: Mode-S Comm-B replies**
- BDS 1,0: Data link capability report - BDS 1,0: Data link capability report
- BDS 1,7: Common usage GICB capability report - BDS 1,7: Common usage GICB capability report
@ -44,9 +36,19 @@ Messages with following Downlink Formats (DF) are supported:
- BDS 6,0: Heading and speed report - BDS 6,0: Heading and speed report
**DF4 / DF20: Altitude code**
**DF5 / DF21: Identity code (squawk code)** If you find this project useful for your research, please considering cite this tool as::
@article{sun2019pymodes,
author={J. {Sun} and H. {V\^u} and J. {Ellerbroek} and J. M. {Hoekstra}},
journal={IEEE Transactions on Intelligent Transportation Systems},
title={pyModeS: Decoding Mode-S Surveillance Data for Open Air Transportation Research},
year={2019},
doi={10.1109/TITS.2019.2914770},
ISSN={1524-9050},
}
Resources Resources

@ -43,15 +43,19 @@ def typecode(msg):
def position(msg0, msg1, t0, t1, lat_ref=None, lon_ref=None): def position(msg0, msg1, t0, t1, lat_ref=None, lon_ref=None):
"""Decode position from a pair of even and odd position message. """Decode surface or airborne position from a pair of even and odd
position messages.
Works with both airborne and surface position messages. Note, that to decode surface position using the position message pair,
the reference position has to be provided.
Args: Args:
msg0 (string): even message (28 hexdigits) msg0 (string): even message (28 hexdigits)
msg1 (string): odd message (28 hexdigits) msg1 (string): odd message (28 hexdigits)
t0 (int): timestamps for the even message t0 (int): timestamps for the even message
t1 (int): timestamps for the odd message t1 (int): timestamps for the odd message
lat_ref (float): latitude of reference position
lon_ref (float): longitude of reference position
Returns: Returns:
(float, float): (latitude, longitude) of the aircraft (float, float): (latitude, longitude) of the aircraft
@ -61,11 +65,10 @@ def position(msg0, msg1, t0, t1, lat_ref=None, lon_ref=None):
tc1 = typecode(msg1) tc1 = typecode(msg1)
if 5 <= tc0 <= 8 and 5 <= tc1 <= 8: if 5 <= tc0 <= 8 and 5 <= tc1 <= 8:
if (not lat_ref) or (not lon_ref): if lat_ref is None or lon_ref is None:
raise RuntimeError( raise RuntimeError(
"Surface position encountered, a reference \ "Surface position encountered, a reference position"
position lat/lon required. Location of \ " lat/lon required. Location of receiver can be used."
receiver can be used."
) )
else: else:
return surface_position(msg0, msg1, t0, t1, lat_ref, lon_ref) return surface_position(msg0, msg1, t0, t1, lat_ref, lon_ref)
@ -79,7 +82,7 @@ def position(msg0, msg1, t0, t1, lat_ref=None, lon_ref=None):
return airborne_position(msg0, msg1, t0, t1) return airborne_position(msg0, msg1, t0, t1)
else: else:
raise RuntimeError("incorrect or inconsistent message types") raise RuntimeError("Incorrect or inconsistent message types")
def position_with_ref(msg, lat_ref, lon_ref): def position_with_ref(msg, lat_ref, lon_ref):

Loading…
Cancel
Save