フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Opening netcdf - Only displays one cell

2 ビュー (過去 30 日間)
Grant
Grant 2013 年 4 月 30 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I've downloaded this file:
from NASA's SEARISE website - Greenland standard data set at (11mb): http://websrv.cs.umt.edu/isis/index.php/Present_Day_Greenland
When I open it with (or other modes I've tried):
ncid = netcdf.open ('Greenland_5km_dev1.0.nc', 'WRITE');
It doesn't give me an error, but all I get is a variable with one cell, 1,1 with 212 written in it. It should be a grid of data on Greenland, though I'm not exactly sure how it would be displayed since I haven't been able to open it.
Thanks

回答 (1 件)

Ashish Uthama
Ashish Uthama 2013 年 4 月 30 日
Grant,
To read data, your best bet is to use ncread.
>> landcover = ncread('Greenland_5km_v1.1.nc','landcover');
>> whos
Name Size Bytes Class Attributes
landcover 301x561 675444 int32
If your version of MATLAB does not have this function, you could look at using the low-level library APIs like netcdf.getvar (see example).
  2 件のコメント
Grant
Grant 2013 年 5 月 1 日
Thanks. I don't have ncread but I used netcdf.getvar.
data = netcdf.getVar (ncid, 'Greenland_5km_v1.1 (1).nc') ??? Error using ==> getVar at 87 Greenland_5km_v1.1 (1).nc is not allowed as an output netCDF datatype
Do you know why this may be the case?
Ashish Uthama
Ashish Uthama 2013 年 5 月 1 日
Grant, please do have a look at the example in the link above. Using the low-level library API is a bit more complex (which is why ncread was added in later releases). The API requires a user to know/find the variable index and then use that as a second argument.
If, after you try the example, you need more help, post back.
If you find this interface too complex, you could also consider using snctools.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by