diff --git a/pyModeS/__init__.py b/pyModeS/__init__.py index 31b6ee8..3cf9c09 100644 --- a/pyModeS/__init__.py +++ b/pyModeS/__init__.py @@ -6,7 +6,10 @@ from .decoder import commb from .decoder import common from .decoder import bds from .extra import aero -from .extra import beastclient +from .extra import tcpclient from .decoder import els # depricated from .decoder import ehs # depricated + +import os +dirpath = os.path.dirname(os.path.realpath(__file__)) diff --git a/pyModeS/decoder/adsb.py b/pyModeS/decoder/adsb.py index ec0d9d2..ce1b1bb 100644 --- a/pyModeS/decoder/adsb.py +++ b/pyModeS/decoder/adsb.py @@ -18,10 +18,12 @@ The wrapper for decoding ADS-B messages """ from __future__ import absolute_import, print_function, division -from pyModeS.decoder import common -import pandas as pd # JoseAndresMR: I suppose you already have pandas in a common function, just change all occurrencies -# from pyModeS.decoder.bds import bds05, bds06, bds09 +import pyModeS as pms +from pyModeS.decoder import common +from pyModeS.decoder import uncertainty + +# from pyModeS.decoder.bds import bds05, bds06, bds09 from pyModeS.decoder.bds.bds05 import airborne_position, airborne_position_with_ref, altitude from pyModeS.decoder.bds.bds06 import surface_position, surface_position_with_ref, surface_velocity from pyModeS.decoder.bds.bds08 import category, callsign @@ -198,65 +200,127 @@ def version(msg): return version -def nic_v1(msg,nic_sup_b): +def nuc_p(msg): + """Calculate NUCp, Navigation Uncertainty Category - Position (ADS-B version 1) + + Args: + msg (string): 28 bytes hexadecimal message string, + + Returns: + int: Horizontal Protection Limit + int: 95% Containment Radius - Horizontal (meters) + int: 95% Containment Radius - Vertical (meters) + + """ + tc = typecode(msg) + + if typecode(msg) < 5 or typecode(msg) > 22: + raise RuntimeError( + "%s: Not a surface position message (5 22: - raise RuntimeError("%s: Not a surface position message (5 22: - raise RuntimeError("%s: Not a surface position message (5 22: - raise RuntimeError("%s: Not a surface position message (5