Skip to content

Commit

Permalink
Read uncached root group vars from cached handle
Browse files Browse the repository at this point in the history
Read uncached rout group variables when the file handle is being cached.
Closes #1195.
  • Loading branch information
gerritholl committed May 8, 2020
1 parent 0d0d582 commit 6c34b6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion satpy/readers/netcdf_utils.py
Expand Up @@ -216,7 +216,10 @@ def _get_var_from_xr(self, group, key):
def _get_var_from_filehandle(self, group, key):
# Not getting coordinates as this is more work, therefore more
# overhead, and those are not used downstream.
g = self.file_handle[group]
if group is None:
g = self.file_handle
else:
g = self.file_handle[group]
v = g[key]
x = xr.DataArray(
da.from_array(v), dims=v.dimensions, attrs=v.__dict__,
Expand Down

0 comments on commit 6c34b6c

Please sign in to comment.