Error reading .nc4 file: 'Unknown file format (NC_ENOTNC)'
Ältere Kommentare anzeigen
Hi there,
Am trying to read a .nc4 file using ncread('filename') and get:
>> ncread('S3A_OL_SRF_20160713_mean_rsr.nc4')
Error using netcdflib
The NetCDF library encountered an error during execution of 'open' function -
'Unknown file format (NC_ENOTNC)'.
Error in netcdf.open (line 60)
[varargout{:}] = netcdflib ( 'open', filename, varargin{1} );
Error in internal.matlab.imagesci.nc/openToRead (line 1249)
this.ncRootid = netcdf.open(this.Filename,'NOWRITE');
Error in internal.matlab.imagesci.nc (line 122)
this.openToRead();
Error in ncread (line 54)
ncObj = internal.matlab.imagesci.nc(ncFile);
Any suggestion will be kindly appreciated
Thanks,
Juancho
Antworten (3)
Tamir Suliman
am 25 Nov. 2016
2 Stimmen
It might be corrupted file or over written try to re copy it again that's the message one gets if the file is not there with the netCDF functions.
2 Kommentare
juan ignacio gossn
am 27 Nov. 2016
Rimal Abeed
am 7 Jan. 2020
His suggestion fixed my problem!
Walter Roberson
am 25 Nov. 2016
Check the first few bytes of the file. If they are 'CDF' then it might be a valid netCDF file but it would not be a NetCDF-4 file. NetCDF-4 files are HDF5 files. If it is NetCDF-4 stored as HDF5, then the file should begin with
Hex: 89 48 44 46 0d 0a 1a 0a
ASCII: \211 HDF \r \n \032 \n
2 Kommentare
juan ignacio gossn
am 27 Nov. 2016
Bearbeitet: Walter Roberson
am 27 Nov. 2016
Walter Roberson
am 27 Nov. 2016
It appears that is related to JSON and to Facebook's OpenGraph protocol.
Possibly there is NetCDF-4 represented in the content, but the data structure itself is not NetCDF-4
juan ignacio gossn
am 21 Dez. 2016
0 Stimmen
Kategorien
Mehr zu NetCDF Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!