From c91bd4bb03bc7c727163bf684e52954215ac8a8e Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Thu, 24 May 2018 12:49:46 +0200 Subject: [PATCH] fix bug --- pyModeS/decoder/bds/bds09.py | 3 ++- pyModeS/streamer/stream.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyModeS/decoder/bds/bds09.py b/pyModeS/decoder/bds/bds09.py index 641f53c..fcb24e3 100644 --- a/pyModeS/decoder/bds/bds09.py +++ b/pyModeS/decoder/bds/bds09.py @@ -74,8 +74,9 @@ def airborne_velocity(msg): hdg = None else: hdg = common.bin2int(mb[14:24]) / 1024.0 * 360.0 + hdg = round(hdg, 2) - trk_or_hdg = round(hdg, 2) + trk_or_hdg = hdg spd = common.bin2int(mb[25:35]) spd = None if spd==0 else spd-1 diff --git a/pyModeS/streamer/stream.py b/pyModeS/streamer/stream.py index 947f4af..f139bfd 100644 --- a/pyModeS/streamer/stream.py +++ b/pyModeS/streamer/stream.py @@ -61,6 +61,8 @@ class Stream(): spd, trk, roc, tag = vdata if tag != 'GS': continue + if (spd is None) or (trk is None): + continue self.acs[icao]['gs'] = spd self.acs[icao]['trk'] = trk