Add data template number 42 to the list of supported templates #264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We recently had a user who wanted to load in data with grib data template number 42, i.e. CCSDS with compression, which we currently do not support.
The data decompression is all done in eccodes, so all we need to get this new template working is
42to the list of supported template numbersthen when iris-grib loads in the data from the grib file, it goes via eccodes, which handles the decompresssion, and so returns a numpy array as normal.
I have kept the code change to iris-grib very lightweight (so I didn't check that the eccodes version running was built with AEC enabled) as all the handling of the data is performed by eccodes so we should just hand that off to eccodes.
If you're interested. if you try to run my branch in an env without AEC, you get the following error:
which is informative enough. I have decided against catching this error in a try/except block and instead putting out our own error. That seems unnecessary.
As for tests I have followed a similarly lightweight approach. As all we're doing in iris-grib is checking the template number against a list of known supported templates, all I've done is test this. I haven't tested that what eccodes returns to us is correctly decompressed data as that should be tested by eccodes.