Should netCDF support GRIB2 as a read-only dispatch layer (as it supports HDF4)? #2526
Replies: 14 comments 9 replies
-
Ed- |
Beta Was this translation helpful? Give feedback.
-
I don't have any strong opinions on whether, once it exists, it should be included. I will ask, though, if it can be done completely independently as a read-only plugin, what the value proposition is for having it included rather than remain its own separate, useful thing? This would mean netCDF-c depends on the NOAA/ECMWF GRIB libraries or picking up (yet another) optional dependency. I know those have been making things complicated (in terms of testing combinations) lately. 🤷♂️ I want to first draw attention to the other option in this space, the Python-based cfgrib library from ECMWF. I'll note that it and netcdf-java took different approaches to mapping GRIB to netCDF. The challenges I'm aware of in doing this mapping:
Don't take those as dissuasion, just passing along the pain points I've watched others struggle with. |
Beta Was this translation helpful? Give feedback.
-
Ed- is there any kind of written specification for the api provided by the current or proposed NOAA grib libraries? |
Beta Was this translation helpful? Give feedback.
-
I guess one other thought comes to mind: if this were to land in NetCDF-c, it should probably have identical behavior to NetCDF-Java to avoid confusing our users. |
Beta Was this translation helpful? Give feedback.
-
This will probably not be entirely possible since CDM is not quite the same data model |
Beta Was this translation helpful? Give feedback.
-
Grib2 is here to stay for decades (much like HDF4). It sounds to me like there is strong institutional (NOAA) support for the initial implementation and perhaps long-term maintenance. If the implementation is up to netCDF standards (and given Ed's involvement that seems almost guaranteed) then I think this would be a win for users. However, there must be many competing demands on the time of the core team, so Grib2 would also have to make sense in terms of the opportunity cost of the core team's time, which I have little insight about. |
Beta Was this translation helpful? Give feedback.
-
There are, I assume two parts to the grib support.
I assume No. 1 is NOAA's responsibility |
Beta Was this translation helpful? Give feedback.
-
The NOAA GRIB libraries and utilities have long-term institutional support from NOAA. They contain some code that is decades old. They are supported as part of the NCEPLIBS libraries, at NOAA EMC. There are about 5 of us on the team, but NCEPLIBS includes many projects besides GRIB libraries. ;-) NOAA now uses netCDF for internal data processing in the UFS (hooray!), but is still required to translate a lot of the final output data into GRIB2. So this library is not going anywhere. GRIB2 is a WMO standard, and it's built into a LOT of operational software and hardware systems. As Charlie notes, it will be around for a decade at least. (Much longer, I suspect.) Despite John's negative views of GRIB2 (some of which I certainly share), it is much beloved in the atmospheric science community, mostly because it has really excellent compression. (The recent addition of quantize and zstandard to netCDF certainly steals some of this thunder, but there is more that can be done.) @DennisHeimbigner my idea is to write the dispatch layer code as part of the NCEPLIBS-g2c library. Once it is working well, then we could move it to netcdf-c. Since I am also writing the GRIB2 library, you can be sure that I will include the functionality I need to make the dispatch layer very simple. As @dopplershift notes, the real challenge will be getting similar or identical answers as netCDF-Java. That's a more long-term goal. |
Beta Was this translation helpful? Give feedback.
-
Personally, I think you both make good arguments for adding netcdf support for grib. |
Beta Was this translation helpful? Give feedback.
-
@DennisHeimbigner there are a handful of RFP's out now that we might be able to write something for; I'll need to take a closer look to make certain, once I'm done preparing my AGU materials :). |
Beta Was this translation helpful? Give feedback.
-
I feel that anything that will help make programs and software more usable is a good thing. The atmospheric community is riddled with different file formats and encoders so expanding NETCDF to include more of these will help users around the globe. It is important to remember that the scientific community is global and not to just focus on Europe and North America. |
Beta Was this translation helpful? Give feedback.
-
What is described: So having the netCDF library understand GRIB2 would have significant benefit. Conversions from GRIB2 to netCDF would become unnecessary, and all netCDF-based tools and code would work with GRIB2 files. All netCDF users would instantly have access to many new meteorological data sets, with no extra work at all! Would be a great feature. The NCAR NCL executable ncl_convert2nc is a great function to read GRIB2 data, but the ability to write in GRIB2 format has always been lacking. |
Beta Was this translation helpful? Give feedback.
-
An update: there has been a lot of progress in this area. One area of progress has been our teaming up with @webisu, author of the wgrib2 package. wgrib2 is extremely capable and deals with many codes. It has an advanced API which seems very capable of supporting the netCDF-GRIB2 dispatch layer. Wgrib2 is NOAA operational software which manipulates GRIB2 files and messages. It's used at NOAA to translate GRIB2 files to netCDF. However, I was overoptimistic as to schedule. We now plan to have our new g2c API out by the end of this year. Between g2c and wgrib2, we will have all the functionality needed for a netCDF integration layer, which I can release as a User-Defined-Format package. Then we can discuss possible inclusion in netcdf-c. |
Beta Was this translation helpful? Give feedback.
-
That is fantastic news, Ed. Thanks for persevering with this project @edwardhartnett and @webisu. |
Beta Was this translation helpful? Give feedback.
-
GRIB2 is the WMO format for weather data. It's a complex and challenging standard. One key characteristic is it's dependency on code tables to interpret data. There are some WMO global tables, but also local tables that anyone can add. This informality means that the same code can mean different things in different files. Some documentation can be found here: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/.
NOAA has several repositories of GRIB2 tools and libraries, in C and Fortran. These are somewhat basic and are not meeting the current needs of NOAA scientists in various ways. They need a serious update to clean up and add missing features. These libraries are part of the Unified Forecast System (UFS) and other important operational products, including the NOAA Aviation weather forecasts.
I am now updating all these NOAA GRIB2 libraries and tools, and am adding the lacking features to make them more useful to NOAA moving forward. Most of this work is taking place in the NCEPLIBS-g2c library.
When I'm done, this will be easy to package up as a netCDF dispatch layer. Most of NOAA's GRIB2 needs have to do with converting between netCDF and GRIB2. So having the netCDF library understand GRIB2 would have significant benefit. Conversions from GRIB2 to netCDF would become unnecessary, and all netCDF-based tools and code would work with GRIB2 files. All netCDF users would instantly have access to many new meteorological data sets, with no extra work at all!
Wouldn't that be cool?
I will get this working as an independent project, using the user-defined format feature. But should this be part of netcdf-c? I rather think it should.
One concern is going to be to present the data the same way that netcdf-java would present it. If there's anyone at Unidata familiar with how netcdf-java interprets GRIB2 files, I would very much welcome some guidance.
@DennisHeimbigner and @WardF what are your thoughts on this.
Beta Was this translation helpful? Give feedback.
All reactions