Problem opening NetCDF file

조회 수: 10 (최근 30일)
Manolis Mylonakis
Manolis Mylonakis 2022년 12월 11일
댓글: millercommamatt 2022년 12월 13일
Hello everyone
I have downloaded hourly data from 200-2005 for wind speeds (two components vertical and horizontal) for a very specific geographical space from “Copernicus”. My data hold a NetCDF format with an ending “.nc”. My file is very small (2.1 mb). Anyone willing to help can get my file "WS.nc" from the attachements.
I have big problem trying to open my file in MATLAB. Anything I tried doesn’t seem to work. I have tried the following:
vardata = ncread('WS.nc');
And I get:
Error using netcdflib
Unable to perform requested action. Filename contains unsupported characters.
Error in netcdf.open (line 67)
[varargout{:}] = netcdflib ( 'open', filename, varargin{1} );
Error in internal.matlab.imagesci.nc/openToRead (line 1278)
this.ncRootid = netcdf.open(this.Filename,'NOWRITE');
Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();
Error in ncread (line 61)
ncObj = internal.matlab.imagesci.nc(ncFile);
Error in Loading_Data (line 9)
vardata = ncread('WS.nc');
Have also tried:
ncdisp('WS.nc');
And I get
Error using netcdflib
Unable to perform requested action. Filename contains unsupported characters.
Error in netcdf.open (line 67)
[varargout{:}] = netcdflib ( 'open', filename, varargin{1} );
Error in internal.matlab.imagesci.nc/openToRead (line 1278)
this.ncRootid = netcdf.open(this.Filename,'NOWRITE');
Error in internal.matlab.imagesci.nc (line 121)
this.openToRead();
Error in ncdisp (line 62)
ncObj = internal.matlab.imagesci.nc(ncFile);
Error in Loading_Data (line 10)
ncdisp('WS.nc');
Am I doing something wrong, or my file is broken?
  댓글 수: 2
Image Analyst
Image Analyst 2022년 12월 11일
편집: Image Analyst 2022년 12월 11일
I don't know how you get any error at all. All the code is commented out except where you assign a string variable.
If you have any more questions, then attach your data (zipped up) and code to read it in with the paperclip icon after you read this:
millercommamatt
millercommamatt 2022년 12월 13일
Worked fine for me
>> a = ncinfo('C:/Users/mille/Desktop/WS.nc')
a =
struct with fields:
Filename: 'C:\Users\mille\Desktop\WS.nc'
Name: '/'
Dimensions: [1×3 struct]
Variables: [1×5 struct]
Attributes: [1×2 struct]
Groups: []
Format: '64bit'
>>

댓글을 달려면 로그인하십시오.

답변 (0개)

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by