pydata / pydata/xarray

NetCDF: Attempting netcdf-4 operation on netcdf-3 file

Open
#5,515 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic-faq
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

I'm trying to open MODIS .hdf files, but I get the error : NetCDF: Attempting netcdf-4 operation on netcdf-3 file. Does anyone knows how to open that files? (https://nsidc.org/data/MOD10C1)

import xarray as xr
xr.open_dataset('MOD10C1.A2000055.061.2020037182124.hdf')

RuntimeError: NetCDF: Attempting netcdf-4 operation on netcdf-3 file

I already opened hdf files from another product without any issue... (https://nsidc.org/data/MOD10CM)

Here are two examples, with one that works and the other one that causes the issue: MODIS.zip

Thanks in advance for your help!

Output of xr.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.8.5 | packaged by conda-forge | (default, Jul 24 2020, 01:25:15)
[GCC 7.5.0]
python-bits: 64
OS: Linux
OS-release: 4.19.0-16-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8
LOCALE: fr_FR.UTF-8
libhdf5: 1.10.6
libnetcdf: 4.7.4

xarray: 0.16.0
pandas: 1.1.0
numpy: 1.19.1
scipy: 1.5.2
netCDF4: 1.5.4
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.4.0
cftime: 1.2.1
nc_time_axis: 1.2.0
PseudoNetCDF: None
rasterio: 1.1.5
cfgrib: 0.9.8.5
iris: None
bottleneck: None
dask: 2.21.0
distributed: 2.21.0
matplotlib: 3.2.0
cartopy: 0.17.0
seaborn: None
numbagg: None
pint: None
setuptools: 49.2.0.post20200712
pip: 20.2
conda: None
pytest: 6.0.0
IPython: 7.16.1
sphinx: None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the xr.open_dataset entry point and reproduce the error with the MODIS.zip examples, comparing the file that opens with the MOD10C1 .hdf file. Read the reported xarray, netCDF4, and HDF5 versions while tracing format handling. Done should be a confirmed supported handling path or a clearly documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.