Unidata / netcdf-java

The Unidata netcdf-java library
https://docs.unidata.ucar.edu/netcdf-java/current/userguide/index.html
BSD 3-Clause "New" or "Revised" License
142 stars 69 forks source link

Handle text on lines in ECMWF BUFR templates #1234

Closed allanfrankwork closed 5 months ago

allanfrankwork commented 12 months ago

Description of Changes

Fixes line parsing for ECMWF BUFR templates.

I was parsing BUFR files and noticed that even the included ecmwf.D0000000000098013001.TXT file failed to be parsed due to comments after the three sections of numbers in some lines.

For the BUFR files I am parsing I'm using other templates which have the same problem - so I worked around that by cutting off the lines before handing them to tablelookup.csv and calling NetcdfFiles.openInMemory(filename)

However with this fix no such workaround is needed and since its also a problem for the file already in netcdf-java/bufr/src/main/resources/resources/bufrTables/local/ecmwf.D0000000000098013001.TXT I thought it would be good to include for all.

For unittest I tried including the file in netcdf-java/bufr/src/test/data but that makes the unittest fail - I suspect due missing bufr templates. If you have other ideas to try please let me know.

PR Checklist

CLAassistant commented 12 months ago

CLA assistant check
All committers have signed the CLA.

allanfrankwork commented 12 months ago

I have found some files that this still does not work on, setting PR to draft.

I'll update here when I know more.

tdrwenski commented 5 months ago

Hi @allanfrankwork, are you still working on this PR?

allanfrankwork commented 5 months ago

I am not.

IIRC, while trying to parse BUFR files from WIS2 I found a couple of different templates that were in slightly different format and the parsing function did not handle those variations.

I will close this PR.

Thanks.