junzis / pyModeS

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

Add vectorized version of df and typecode functions. #90

Open wrobell opened 3 years ago

wrobell commented 3 years ago

This is work in progress to start discussion to add vectorized versions of the pyModeS functions.

This pull request adds vectorized df and typecode functions.

Overloaded functions are exposed via pyModeS.common module, because the original functions are defined as common. This is bit messy at the moment and requires further discussion about the structure of submodules of the library.

wrobell commented 3 years ago

I am looking into implementation of altitude function. I can see that pyModeS has three functions.

IMHO, this is bit problematic. For an array of messages, I would prefer to have single API function to calculate altitude for all types of messages.

Would you be OK with pyModeS API changes? Probably, these would be needed if you accept the direction I am taking in this pull request - df and typecode functions are overloaded and accept a string message or array of messages.

junzis commented 3 years ago

I am looking into implementation of altitude function. I can see that pyModeS has three functions.

IMHO, this is bit problematic. For an array of messages, I would prefer to have single API function to calculate altitude for all types of messages.

Would you be OK with pyModeS API changes? Probably, these would be needed if you accept the direction I am taking in this pull request - df and typecode functions are overloaded and accept a string message or array of messages.

Yes, we can change API if it makes the code cleaner and easier to use. Let's try to consolidate these functions:

wrobell commented 3 years ago

Regarding the 12-bit vs 13-bit altitude data parsing

13-bit version can be converted into 12-bit with bit mask&shift, then use one implementation to get the result?

wrobell commented 3 years ago

Regarding 14/28 digit messages. 28-digit messages are always df=(17, 18), so it is easy to distinguish between them?

junzis commented 3 years ago

DF 20 and 21 also have 28 hex digits.