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

BUFR file with all date values off-by-one #33

Closed
akrherz opened this issue Jan 25, 2024 · 2 comments
Closed

BUFR file with all date values off-by-one #33

akrherz opened this issue Jan 25, 2024 · 2 comments
Labels

Comments

@akrherz
Copy link
Contributor

akrherz commented Jan 25, 2024

Thanks for the work on this excellent library. I have been having great success with processing surface observations transmitted in near realtime in BUFR format. I have been doing this for a couple of months now and occasionally hit an oddity with a random BUFR file seemingly having a timestamp that is one-off from what the current time is. An example is this:

example.zip

pybufrkit appears to decode this as a timestamp of 2025-02-26 19:01+00, which is strangely +1 in all year, month, day, hour, and minute from the current timestamp. I am unsure of a means to fully debug this outside of pybufrkit and I could totally see this just being an encoding issue with the upstream generator, but figured I would drop an example here to see, if by chance, there is something else going on!

Thank you.

@ywangd ywangd closed this as completed in be91cb6 Jan 26, 2024
@ywangd
Copy link
Owner

ywangd commented Jan 26, 2024

Thanks for reporting this issue. It turned out to be an bug in decoding compressed data. The issue is that an one-bit increment of value one should be considered as missing data instead of an normal increment. Quote from WMO specs

94.1.6 The convention for representing missing data for compressed data within the binary Data section shall be to set the corresponding increments to fields of all ones.

Previously the code had a special logic for 1-bit increment. Apperantly this is not what the specs says. I have now pushed a fix (be91cb6) and published a new version 0.2.22 to PyPI.

@ywangd ywangd added the bug label Jan 26, 2024
@akrherz
Copy link
Contributor Author

akrherz commented Jan 26, 2024

Oh wow, thank you. I was very worried that this was a goose chase! I've pushed a conda-forge version update now as well.

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

No branches or pull requests

2 participants