dimensions of opened NetCDF files
이전 댓글 표시
Hi,
I frequently use NetCDF files to load data in Matlab:
ncload mydata.nc; for a quick open of new files
nc_varget(); to get specific variables
Now, I changed to a new workplace and found here the handling with
ncid = netcdf.open('myfile.nc','nowrite');
varid = netcdf.reqvarid(ncid,'variable');
data = netcdf.getVar(ncid,varid);
This works, but the dimension is changed: While ncload loads the variable correctly as e.g. 12 x 40 x 180 x 90 (as described in the NetCDF file, ncdump),
with netcdf.getVar I get a variable of size 90 x 180 x 40 x12, which is quite inconvenient. Is this a usual behavior of netcdf.xxx or is there something I didn't recognize?
I appreciate any information, Christoph
채택된 답변
추가 답변 (2개)
John
2012년 10월 22일
1 개 추천
Hi Christoph,
The "ncload" function referred to is part of the "netcdf toolbox", which is a very old and unsupported piece of software. It transposes the data when it reads and writes, whereas the native netcdf.getVar and putVar functions do not transpose, thus preserving the ordering of the data.
댓글 수: 1
Odontungalag Dorjsuren
2015년 4월 28일
0 개 추천
HI. How to open data .nc
카테고리
도움말 센터 및 File Exchange에서 NetCDF Files에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!