pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 86 forks source link

OSError: [Errno -51] NetCDF: Unknown file format: b'/Users/Sofia/desktop/air.mon.mean.nc' #132

Closed sofiafarina closed 2 years ago

sofiafarina commented 4 years ago

Hello! I have tried to run the example climate_network.py, I have also downloaded the air.mon.mean.nc from the link you suggested, but I get this error.. Do you know how could I solve it?

Thank you very much

Reading NetCDF File and converting data to NumPy array...
Traceback (most recent call last):
  File "climate_network.py", line 81, in <module>
    window=WINDOW, time_cycle=TIME_CYCLE)
  File "/anaconda3/envs/clinet/lib/python3.6/site-packages/pyunicorn/climate/climate_data.py", line 174, in Load
    vertical_level=vertical_level)
  File "/anaconda3/envs/clinet/lib/python3.6/site-packages/pyunicorn/core/data.py", line 381, in _load_data
    silence_level)
  File "/anaconda3/envs/clinet/lib/python3.6/site-packages/pyunicorn/core/data.py", line 281, in _get_netcdf_data
    f = netCDF4.Dataset(file_name, "r")
  File "netCDF4/_netCDF4.pyx", line 2135, in netCDF4._netCDF4.Dataset.__init__
  File "netCDF4/_netCDF4.pyx", line 1752, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -51] NetCDF: Unknown file format: b'/Users/Sofia/desktop/air.mon.mean.nc'
lenas95 commented 2 years ago

Hi @sofiafarina ,

sorry for the late response. The NETCFD File you are using doesn't seem to be a NETCFD File. Please check on that. Here are the problem codes from the official website: http://cucis.ece.northwestern.edu/projects/PnetCDF/doc/pnetcdf-c/Error-Codes.html

Bests, Lena