semuconsulting / pyspartn

Python library for parsing SPARTN protocol messages.
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Release candidate 0.3.3 beta #22

Closed semuadmin closed 6 months ago

semuadmin commented 7 months ago

pyspartn Pull Request Template

Description

  1. Update handling of SPARTN-1X-BPAC and SPARTN-1X-EAS-DYN message types (not yet tested).
  2. Add improved handling of half-day rollovers when decrypting SPARTN datastreams - thanks to @jonathanmuller @JonathanMullerGeosatis for contribution:

Different constellations are using different time reference : GPS = GAL = QZSS = UTC -18s BEI = UTC -14 GLO = UTC + 3h (exactly 3h, 0 seconds)

Because of that, passing a basedate to convert a 16 bits timetag to 32 bits unambiguous can be either

Correct
Wrong because basedate is ahead of the constellation (GPS for example)
Wrong because the basedate is behind the constellation (GLONASS for example)

In order to account for those time difference not being in sync, 3 unambitious solutions are calculated :

At the time of basedate
12h after basedate
12h prior to basedate
The closest in time is the one returned

By doing so, basedate can be up to 3h inaccurate (as GLONASS is +3h ahead) and still allow for a correct parsing

Fixes #17

Testing

Please test all changes, however trivial, against the supplied pytest suite tests/test_*.py. Please describe any test cases you have amended or added to this suite to maintain >= 85% code coverage.

Checklist: