Fix ABI L1b/L2 time dimension causing issues with newer xarray #1036
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.
Pointed out originally by @TAlonglong on slack. @yufeizhu600 also helped debug this one.
It seems in newer versions of xarray that the scalar variables in a NetCDF variable like
t
in the ABI L1b files is no longer treated as a dimension (self.nc.dims
) and is only considered a coordinate variable. The ABI base reader specifically checked for it existing in thedims
before renaming it totime
to be more compatible with the rest of Satpy. This PR fixes this by checking the.dims
and the.coords
for at
variable. Continuing to check in.dims
may be redundant, but I think it is useful in the case there is a declared dimension in a NetCDF file but no corresponding coordinate variable defined in the file.To test this I had to update the ABI L1b/L2 and GLM L2 tests to stop using a "FakeDataset" object when a normal xarray Dataset object will do just fine.
flake8 satpy