pyModeS icon indicating copy to clipboard operation
pyModeS copied to clipboard

Add vectorized version of df and typecode functions.

Open wrobell opened this issue 4 years ago • 5 comments

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 avatar Dec 31 '20 00:12 wrobell

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.

wrobell avatar Jan 04 '21 22:01 wrobell

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:

  • gray2alt() can be removed and merged into altitude() directly.
  • altcode() can also be merged into altitude, but then we have to handle multiple input types, ie.14-digit and 28-digit hexadcimal string, and 13-digit binary string. This is because altitude bits are located in different places for Mode S and ADS-B messages. Any suggestions?

junzis avatar Jan 06 '21 11:01 junzis

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

  • 12-bit version: 1 bit is unused
  • 13-bit version: 2 bits are unused

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

wrobell avatar Jan 31 '21 12:01 wrobell

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

wrobell avatar Feb 21 '21 11:02 wrobell

DF 20 and 21 also have 28 hex digits.

junzis avatar Mar 12 '21 12:03 junzis