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

[v7.x]: BUFR: Negative and unknown enum value #759

Open
1 task done
lesserwhirls opened this issue Jul 12, 2021 · 5 comments
Open
1 task done

[v7.x]: BUFR: Negative and unknown enum value #759

lesserwhirls opened this issue Jul 12, 2021 · 5 comments
Labels
bug Something isn't working ver5 version 5 only. ver6 version 6 ver7 version 7

Comments

@lesserwhirls
Copy link
Collaborator

Versions impacted by the bug

v5.x, v6.x, v7.x

What went wrong?

Report from mailing list:

Hi,

I am using netcdf-java 5.3.3 to read various bufr-files. It works very well, but 2 things are strange:

  1. Compared to other tools, I got sometimes different values for the variable obs.Radiosonde_type, -114 in this case. This is a invalid value, since the values of this enum are only positive.

  2. I also got Unknown enum value for several enums, for example obs.Radiosonde_type. In netcdf-java 5.4.1 these values are NULL. I am not sure, if this a problem with your library, since many (not all) enums can be transformed to string (NetcdfDatasets does this job) and only BUFRdisplay was able to transform obs.Radiosonde_type for me.

Here are my test results:

  • BUFR Viewer

    LSSW    0 02 011    RADIOSONDE TYPE    CODE_TABLE    10**  0    0    8 bits    142    [ 142.000 ]
    DWSG    0 02 011    RADIOSONDE TYPE    CODE_TABLE    10**  0    0    8 bits    124    [ 124.000 ]
  • [toolsUI](5.3.3 https://www.unidata.ucar.edu/downloads/netcdf-java/)

    LSSW    Radiosonde_type =   "Unknown enum value=-114" CodeTable 0-2-11
    DWSG    Radiosonde_type =   "Unknown enum value=124" CodeTable 0-2-11
  • toolsUI-5.4.1 Only NULL for both files

  • BUFRdisplay

    LSSW    8,"Radiosonde type","Code table","0-02-011",142 -> Vaisala RS41 with pressure derived from GPS 
    height/AUTOSONDE (Finland)
    DWSG    8,"Radiosonde type","Code table","0-02-011",124 -> Vaisala RS41/AUTOSONDE (Finland)
  • ecCodes

    LSSW    "key" : "radiosondeType", "value" : 142, "units" : "CODE TABLE"
    DWSG    "key" : "radiosondeType", "value" : 124, "units" : "CODE TABLE"

After searching for Vaisala RS41/AUTOSONDE (Finland) in your repository, I found this:

<Common_C02_20181107_en>
<No>120</No>
<DateOfAssignment_en>03/11/2011</DateOfAssignment_en>
<CodeFigureForrara>24</CodeFigureForrara>
<CodeFigureForBUFR>124</CodeFigureForBUFR>
<RadiosondeSoundingSystemUsed_en>Vaisala RS41/AUTOSONDE (Finland)</RadiosondeSoundingSystemUsed_en>
<Status>Operational</Status>
</Common_C02_20181107_en>

This file is or should be used here:

// C2("Radiosondes", 2, 1, new String[]{"CodeFigureForBUFR", null, "RadiosondeSoundingSystemUsed_en"}),

Unfortunately only C1, C3 and C12 are active at the moment. C2 is commented out. This explains the Unknown enum value.

Relevant stack trace

No response

Relevant log messages

No response

If you have an example file that you can share, please attach it to this issue.

If so, may we include it in our test datasets to help ensure the bug does not return once fixed?
Note: the test datasets are publicly accessible without restriction.

Yes

Code of Conduct

  • I agree to follow the UCAR/Unidata Code of Conduct
@lesserwhirls lesserwhirls added bug Something isn't working ver5 version 5 only. ver6 version 6 ver7 version 7 labels Jul 12, 2021
@lesserwhirls
Copy link
Collaborator Author

@lesserwhirls
Copy link
Collaborator Author

lesserwhirls commented Jul 12, 2021

Thank you for your report @netty-jawn!

@ghost
Copy link

ghost commented Jul 14, 2021

Thanks!

@ghost
Copy link

ghost commented Sep 8, 2021

Any progress in this issue?

Regarding the negative number:
The -114 is not so wrong at all. The Windows calculator gave me this binary representation of both values:

 142 =                                                         10001110
-114 = 1111111111111111111111111111111111111111111111111111111110001110

@JP95Git
Copy link

JP95Git commented Jun 22, 2022

@JP95Git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ver5 version 5 only. ver6 version 6 ver7 version 7
Projects
None yet
Development

No branches or pull requests

2 participants