From 4a6d3334a7d95ae2bff29ecb53c9b0e3c46101d0 Mon Sep 17 00:00:00 2001 From: Alexander Hirsch Date: Wed, 5 Jun 2019 16:11:50 -0700 Subject: [PATCH] Decoder recognizes supersonic velocity subtype If the aircraft velocity message indicates a supersonic subtype (2 or 4), multiply the derived velocity by four. This is in accordance with Table A-2-9[a, b] in the "Technical Provisions for Mode-S Services and Extended Squitter" --- pyModeS/decoder/bds/bds09.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyModeS/decoder/bds/bds09.py b/pyModeS/decoder/bds/bds09.py index 3ccdae6..44d7a31 100644 --- a/pyModeS/decoder/bds/bds09.py +++ b/pyModeS/decoder/bds/bds09.py @@ -59,9 +59,13 @@ def airborne_velocity(msg, rtn_sources=False): if subtype in (1, 2): v_ew_sign = -1 if mb[13]=='1' else 1 v_ew = common.bin2int(mb[14:24]) - 1 # east-west velocity + if subtype == 2: # Supersonic + v_ew *= 4 v_ns_sign = -1 if mb[24]=='1' else 1 v_ns = common.bin2int(mb[25:35]) - 1 # north-south velocity + if subtype == 2: # Supersonic + v_ns *= 4 v_we = v_ew_sign * v_ew v_sn = v_ns_sign * v_ns @@ -88,6 +92,8 @@ def airborne_velocity(msg, rtn_sources=False): spd = common.bin2int(mb[25:35]) spd = None if spd==0 else spd-1 + if subtype == 4: # Supersonic + spd *= 4 if mb[24]=='0': tag = 'IAS'