From d91ad261cdb159d4f20481ac0e222d432a86f0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Huy=20V=C3=BB?= Date: Fri, 16 Mar 2018 11:22:10 +0100 Subject: [PATCH 1/2] Too rough rounding track/heading angles Due to resolution of 0.175 degrees, rounding difference up to 0.05 degrees can occur. --- pyModeS/decoder/ehs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyModeS/decoder/ehs.py b/pyModeS/decoder/ehs.py index 7804347..28063f8 100644 --- a/pyModeS/decoder/ehs.py +++ b/pyModeS/decoder/ehs.py @@ -585,7 +585,7 @@ def trk50(msg): if trk < 0: trk = 360 + trk - return round(trk, 1) + return round(trk, 2) def gs50(msg): @@ -726,7 +726,7 @@ def hdg53(msg): if hdg < 0: hdg = 360 + hdg - return round(hdg, 1) + return round(hdg, 2) def ias53(msg): @@ -882,7 +882,7 @@ def hdg60(msg): if hdg < 0: hdg = 360 + hdg - return round(hdg, 1) + return round(hdg, 2) def ias60(msg): From ef40acdbfd8ea6d7ff28d05a7520eabe97c870eb Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Fri, 16 Mar 2018 11:56:49 +0100 Subject: [PATCH 2/2] Update ehs.py let's make them to 3 decimals even --- pyModeS/decoder/ehs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyModeS/decoder/ehs.py b/pyModeS/decoder/ehs.py index 28063f8..f7b5b10 100644 --- a/pyModeS/decoder/ehs.py +++ b/pyModeS/decoder/ehs.py @@ -585,7 +585,7 @@ def trk50(msg): if trk < 0: trk = 360 + trk - return round(trk, 2) + return round(trk, 3) def gs50(msg): @@ -726,7 +726,7 @@ def hdg53(msg): if hdg < 0: hdg = 360 + hdg - return round(hdg, 2) + return round(hdg, 3) def ias53(msg): @@ -882,7 +882,7 @@ def hdg60(msg): if hdg < 0: hdg = 360 + hdg - return round(hdg, 2) + return round(hdg, 3) def ias60(msg):