马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
------------------------------------------------------------------------------------------------------------------
1、File Function文件操作
(1). netcdf.open: open netCDF source.
ncid = netcdf.open(filename, mode)
parameter: 'WRITE' for read-write access, 'SHARE' for synchronous(同时) file updates, or 'NOWRITE' for read-only access.
(2). netcdf.inq: Return information about netCDF file.
[ndims, nvars, ngatts, unlimdimid]=netcdf.inq(ncid)
ndims: number of dimensions
nvars: number of variables
ngatts: number of global attributes 'nglobalatts'
unlimdimid: identity of the unlimited dimension
(3). netcdf.close: Close netCDF file.
netcdf.close(ncid)
--------------------------------------------------------------------------------------
2、dimension functions维数
netcdf.inqDim: Return netCDF dimension name and length.
[dimname, dimlen] = netcdf.inqDim(ncid,dimid)
dimd: dimension ID
--------------------------------------------------------------------------------------
3、Variable Functions变量
(1). netcdf.inqVarID: Return ID associated with variable name.
varid = netcdf.inqVarID(ncid,varname)
(2). netcdf.getVar: Return data from netCDF variable.
data = netcdf.getVar(ncid,varid)
data = netcdf.getVar(ncid,varid,start)
data = netcdf.getVar(ncid,varid,start,count)
data = netcdf.getVar(ncid,varid,start,count,stride)
(3). netcdf.inqVar: Return information about netCDF variable.
[varname,xtype,dimids,natts] = netcdf.inqVar(ncid,varid)
dimids: dimensions IDs,
natts: the number of attributes of the variable identified by varid.
--------------------------------------------------------------------------------------
4、Attribute Functions变量属性
(1). netcdf.inqAttName: Return name of netCDF attribute.
attname = netcdf.inqAttName(ncid,varid,attnum) returns the name of an attribute given the attribute number.(从Variable Functions(3)中可知道)
(2). netcdf.getAtt: Return netCDF attribute.
attrvalue = netcdf.getAtt(ncid,varid,attname)
(3). netcdf.inqAtt:Return information about netCDF attribute.
[xtype,attlen] = netcdf.inqAtt(ncid,varid,attname) [returns the datatype and length of an attribute identified by attname.]
--------------------------------------------------------------------------------------
----the--end---
转自:http://blog.sina.com.cn/u/66678321 |