diff --git a/pyModeS/decoder/bds/bds50.py b/pyModeS/decoder/bds/bds50.py index 9055df0..4965c2b 100644 --- a/pyModeS/decoder/bds/bds50.py +++ b/pyModeS/decoder/bds/bds50.py @@ -50,7 +50,7 @@ def is50(msg: str) -> bool: return False tas = tas50(msg) - if tas is not None and tas > 500: + if tas is not None and tas > 600: return False if (gs is not None) and (tas is not None) and (abs(tas - gs) > 200): @@ -145,11 +145,9 @@ def rtrk50(msg: str) -> Optional[float]: if d[34] == "0": return None - if d[36:45] == "111111111": - return None - sign = int(d[35]) # 1 -> negative value, two's complement value = common.bin2int(d[36:45]) + if sign: value = value - 512 diff --git a/pyModeS/decoder/bds/bds60.py b/pyModeS/decoder/bds/bds60.py index 98c9a79..39db087 100644 --- a/pyModeS/decoder/bds/bds60.py +++ b/pyModeS/decoder/bds/bds60.py @@ -150,10 +150,8 @@ def vr60baro(msg: str) -> Optional[int]: sign = int(d[35]) # 1 -> negative value, two's complement value = common.bin2int(d[36:45]) - if value == 0 or value == 511: # all zeros or all ones - return 0 - - value = value - 512 if sign else value + if sign: + value = value - 512 roc = value * 32 # feet/min return roc @@ -176,10 +174,8 @@ def vr60ins(msg: str) -> Optional[int]: sign = int(d[46]) # 1 -> negative value, two's complement value = common.bin2int(d[47:56]) - if value == 0 or value == 511: # all zeros or all ones - return 0 - - value = value - 512 if sign else value + if sign: + value = value - 512 roc = value * 32 # feet/min return roc diff --git a/pyproject.toml b/pyproject.toml index 6d1cb45..954e208 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyModeS" -version = "2.18" +version = "2.19" description = "Python Mode-S and ADS-B Decoder" authors = ["Junzi Sun "] license = "GNU GPL v3"