Skip to content

Commit 2c40302

Browse files
committed
minor fix for bds 50 and 60; increment version to 2.19
1 parent b4be551 commit 2c40302

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

pyModeS/decoder/bds/bds50.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def is50(msg: str) -> bool:
5050
return False
5151

5252
tas = tas50(msg)
53-
if tas is not None and tas > 500:
53+
if tas is not None and tas > 600:
5454
return False
5555

5656
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]:
145145
if d[34] == "0":
146146
return None
147147

148-
if d[36:45] == "111111111":
149-
return None
150-
151148
sign = int(d[35]) # 1 -> negative value, two's complement
152149
value = common.bin2int(d[36:45])
150+
153151
if sign:
154152
value = value - 512
155153

pyModeS/decoder/bds/bds60.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,8 @@ def vr60baro(msg: str) -> Optional[int]:
150150
sign = int(d[35]) # 1 -> negative value, two's complement
151151
value = common.bin2int(d[36:45])
152152

153-
if value == 0 or value == 511: # all zeros or all ones
154-
return 0
155-
156-
value = value - 512 if sign else value
153+
if sign:
154+
value = value - 512
157155

158156
roc = value * 32 # feet/min
159157
return roc
@@ -176,10 +174,8 @@ def vr60ins(msg: str) -> Optional[int]:
176174
sign = int(d[46]) # 1 -> negative value, two's complement
177175
value = common.bin2int(d[47:56])
178176

179-
if value == 0 or value == 511: # all zeros or all ones
180-
return 0
181-
182-
value = value - 512 if sign else value
177+
if sign:
178+
value = value - 512
183179

184180
roc = value * 32 # feet/min
185181
return roc

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyModeS"
3-
version = "2.18"
3+
version = "2.19"
44
description = "Python Mode-S and ADS-B Decoder"
55
authors = ["Junzi Sun <j.sun-1@tudelft.nl>"]
66
license = "GNU GPL v3"

0 commit comments

Comments
 (0)