html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/5515#issuecomment-1485155675,https://api.github.com/repos/pydata/xarray/issues/5515,1485155675,IC_kwDOAMm_X85Yha1b,5821660,2023-03-27T13:59:40Z,2023-03-27T13:59:40Z,MEMBER,"Late to the party. If this is still an issue for you @mickaellalande, MODIS data can also be read using `engine=""rasterio""` (needs `rioxarray`).
```python
In [1]: import xarray as xr
...: with xr.open_dataset('source/MODIS/MOD10C1.A2000055.061.2020037182124.hdf', engine=""rasterio"") as ds:
...: display(ds)
...:
Dimensions: (band: 1, x: 7200, y: 3600)
Coordinates:
* band (band) int64 1
* x (x) float64 -180.0 -179.9 -179.9 ... 179.9 180.0
* y (y) float64 89.97 89.92 89.88 ... -89.93 -89.98
spatial_ref int64 ...
Data variables:
Day_CMG_Snow_Cover (band, y, x) float32 ...
Day_CMG_Clear_Index (band, y, x) float32 ...
Day_CMG_Cloud_Obscured (band, y, x) float32 ...
Snow_Spatial_QA (band, y, x) float32 ...
Attributes: (12/50)
ALGORITHMPACKAGEACCEPTANCEDATE: 09-2013
ALGORITHMPACKAGEMATURITYCODE: Normal
ALGORITHMPACKAGENAME: MOD_PR10C1
ALGORITHMPACKAGEVERSION: 6
ASSOCIATEDINSTRUMENTSHORTNAME.1: MODIS
ASSOCIATEDPLATFORMSHORTNAME.1: Terra
... ...
SNOWCOVERPERCENT: 28
SOUTHBOUNDINGCOORDINATE: -90.0
SPSOPARAMETERS: none
VERSIONID: 61
WESTBOUNDINGCOORDINATE: -180.0
ZONEIDENTIFIER: Other Grid System
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,928381010
https://github.com/pydata/xarray/issues/5515#issuecomment-867821781,https://api.github.com/repos/pydata/xarray/issues/5515,867821781,MDEyOklzc3VlQ29tbWVudDg2NzgyMTc4MQ==,1217238,2021-06-24T17:30:07Z,2021-06-24T17:30:07Z,MEMBER,"OK, so the (misleading) error message here is ultimately coming from the underlying netCDF library, not Xarray.
Inspecting these files, it looks like they are HDF4 files, not netCDF3. We haven't really tested HDF4 files much with Xarray, but it would be nice to support them.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,928381010
https://github.com/pydata/xarray/issues/5515#issuecomment-867405472,https://api.github.com/repos/pydata/xarray/issues/5515,867405472,MDEyOklzc3VlQ29tbWVudDg2NzQwNTQ3Mg==,20254164,2021-06-24T07:24:35Z,2021-06-24T14:37:51Z,CONTRIBUTOR,"```pytb
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
in
----> 1 xr.open_dataset(root_data_path+'/MODIS/MOD10C1_Terra/MOD10C1.A2000055.061.2020037182124.hdf')
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/backends/api.py in open_dataset(filename_or_obj, group, decode_cf, mask_and_scale, decode_times, autoclose, concat_characters, decode_coords, engine, chunks, lock, cache, drop_variables, backend_kwargs, use_cftime, decode_timedelta)
543
544 with close_on_error(store):
--> 545 ds = maybe_decode_store(store)
546
547 # Ensure source filename always stored in dataset object (GH issue #2550)
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/backends/api.py in maybe_decode_store(store, lock)
449
450 def maybe_decode_store(store, lock=False):
--> 451 ds = conventions.decode_cf(
452 store,
453 mask_and_scale=mask_and_scale,
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/conventions.py in decode_cf(obj, concat_characters, mask_and_scale, decode_times, decode_coords, drop_variables, use_cftime, decode_timedelta)
578 encoding = obj.encoding
579 elif isinstance(obj, AbstractDataStore):
--> 580 vars, attrs = obj.load()
581 extra_coords = set()
582 file_obj = obj
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/backends/common.py in load(self)
121 """"""
122 variables = FrozenDict(
--> 123 (_decode_variable_name(k), v) for k, v in self.get_variables().items()
124 )
125 attributes = FrozenDict(self.get_attrs())
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/backends/netCDF4_.py in get_variables(self)
397
398 def get_variables(self):
--> 399 dsvars = FrozenDict(
400 (k, self.open_store_variable(k, v)) for k, v in self.ds.variables.items()
401 )
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/core/utils.py in FrozenDict(*args, **kwargs)
436
437 def FrozenDict(*args, **kwargs) -> Frozen:
--> 438 return Frozen(dict(*args, **kwargs))
439
440
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/backends/netCDF4_.py in (.0)
398 def get_variables(self):
399 dsvars = FrozenDict(
--> 400 (k, self.open_store_variable(k, v)) for k, v in self.ds.variables.items()
401 )
402 return dsvars
~/miniconda3/envs/phd_v3/lib/python3.8/site-packages/xarray/backends/netCDF4_.py in open_store_variable(self, name, var)
374 # netCDF4 specific encoding; save _FillValue for later
375 encoding = {}
--> 376 filters = var.filters()
377 if filters is not None:
378 encoding.update(filters)
netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.filters()
netCDF4/_netCDF4.pyx in netCDF4._netCDF4._ensure_nc_success()
RuntimeError: NetCDF: Attempting netcdf-4 operation on netcdf-3 file
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,928381010
https://github.com/pydata/xarray/issues/5515#issuecomment-866968227,https://api.github.com/repos/pydata/xarray/issues/5515,866968227,MDEyOklzc3VlQ29tbWVudDg2Njk2ODIyNw==,1217238,2021-06-23T16:03:58Z,2021-06-23T16:03:58Z,MEMBER,could you kindly share the full error traceback?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,928381010