Modifies coord attrs lookup for non-coord levels on GRIB2 files #204
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.
I ran across an interesting edge case while trying to read in some GRIB files from the NOAA HRRR model using @martindurant's awesome improvements from #198. The edge case occurs when you supply a
typeOfLevel
filter, but the level is not actually a coordinate in the dataset. The most common use case for this is selecting the surface fields (including certain thermodynamic fields like skin temperature, or winds). In this case, the attribute lookup into the decodedCOORD_ATTRS
on the dataset hat cfgrib produces will fail, but thescan_grib
will keep on running through, producing empty references that need to be dealt with.The changelist here is a very, very naive way of fixing this - simply grabbing the basic attributes that have already been inspected. I'm sure there are better ways. But this PR is primarily to exposure to the community and get feedback for a better solution.
To Reproduce