From b24c1101b6ea1c94bb11e6a2e719289927959b9f Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Fri, 14 Dec 2018 17:22:55 +0100 Subject: [PATCH] add DF 0 and 16 to altcode --- pyModeS/decoder/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyModeS/decoder/common.py b/pyModeS/decoder/common.py index 4225568..99384c4 100644 --- a/pyModeS/decoder/common.py +++ b/pyModeS/decoder/common.py @@ -205,8 +205,8 @@ def altcode(msg): int: altitude in ft """ - if df(msg) not in [4, 20]: - raise RuntimeError("Message must be Downlink Format 4 or 20.") + if df(msg) not in [0, 4, 16, 20]: + raise RuntimeError("Message must be Downlink Format 0, 4, 16, or 20.") # Altitude code, bit 20-32 mbin = hex2bin(msg)