1

When I try to open a netcdf4 file containing tropomi data of the ESA copernicus mission, I run into the following error.

[Errno -101] NetCDF: HDF error: b'5P_NRTI_L2__CO_____20190505T104819_20190505T105319_08073_01_010301_20190505T124936.nc'

the code that I use is simply

import netCDF4
rootgrp = netCDF4.Dataset(5P_NRTI_L2__CO_____20190505T104819_20190505T105319_08073_01_010301_20190505T124936.nc, "r",format="NETCDF4")

If i re-install netCDF4 or shutdown my computer a few times it succeeds in reading the file again (though this trick does not always work). But it's just a matter of time before it starts failing again. Does anyone have any idea what causes this problem? I work under Ubuntu 18.

2
  • Do you close the file properly after opening it? Commented May 6, 2019 at 13:54
  • Yes, the error also persists after restarting my computer. So it is probably not that. Commented May 8, 2019 at 8:12

1 Answer 1

1

python-netCDF4 might be buggy, here is an example with another library which normally works for me (https://github.com/shoyer/h5netcdf):

import h5netcdf.legacyapi as netCDF4

with netCDF4.Dataset('mydata.nc', 'w') as ds:
   ...
Sign up to request clarification or add additional context in comments.

1 Comment

This works. If it breaks down over time in the same way as the netCDF4 package I will report back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.