Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vectorized version of df and typecode functions. #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wrobell
Copy link
Contributor

@wrobell wrobell commented Dec 31, 2020

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
Copy link
Contributor Author

wrobell commented Jan 4, 2021

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
Copy link
Owner

junzis commented Jan 6, 2021

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?

@wrobell
Copy link
Contributor Author

wrobell commented Jan 31, 2021

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
Copy link
Contributor Author

wrobell commented Feb 21, 2021

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

@junzis
Copy link
Owner

junzis commented Mar 12, 2021

DF 20 and 21 also have 28 hex digits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants