junzis / pyModeS

Python decoder for Mode S and ADS-B signals
GNU General Public License v3.0
546 stars 153 forks source link

moved pms.adsb.surface_velocity under typecode 5-8 #49

Closed espinielli closed 5 years ago

espinielli commented 5 years ago

I tried to pms.adsb.surface_velocity() as per README with a typecode 19 msg and got an error:

>>> import pyModeS as pms
>>> msg = '8d484966990076b9e0762d5ff92c'
>>> pms.adsb.typecode(msg)
19
>>> pms.adsb.surface_velocity(msg)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\spi\AppData\Roaming\Python\Python27\site-packages\pyModeS\decoder\bds\bds06.py", line 162, in surface_velocity
    raise RuntimeError("%s: Not a surface message, expecting 5<TC<8" % msg)
RuntimeError: 8d484966990076b9e0762d5ff92c: Not a surface message, expecting 5<TC<8

so I propose this fix. I used pyModeS 2.2

junzis commented 5 years ago

Thanks, @espinielli. You are right. TC 19 is only broad by airborne aircarft.