博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ncinfo
阅读量:4584 次
发布时间:2019-06-09

本文共 3093 字,大约阅读时间需要 10 分钟。

ncinfo

Return information about NetCDF data source

Syntax

finfo = ncinfo(source)
vinfo = ncinfo(source,varname)
ginfo = ncinfo(source,groupname)

Description

finfo = ncinfo(source) returns information in the structure finfo about the entire NetCDF data source specified by source, where source can be the name of a NetCDF file or the URL of an OPeNDAP NetCDF data source.

vinfo = ncinfo(source,varname) returns information in the structure vinfo about the variable varname in source.

ginfo = ncinfo(source,groupname) returns information in the structure ginfo about the group groupname in source (only NetCDF4 data sources).

 

Note:   Use ncdisp for visual inspection of a NetCDF source.

 

Input Arguments

source       Text string specifying the name of a NetCDF file or the URL of an OPeNDAP NetCDF data source.
varname    Text string specifying the name of a variable in a NetCDF file or OPeNDAP data source.
groupname    Text string specifying the name of a group in a NetCDF file or OPeNDAP data source.

 

Output Arguments

finfoA structure with the following fields.

FieldDescription

Filename                     NetCDF file name or OPeNDAP URL
Name                         '/', indicating the full file
Dimensions                 An array of structures with these fields:

                                  Name                                                                                      Dimension name

                                  Length                                                                                     Current length of dimension
                                  Unlimited                                                                                 Boolean flag, true for unlimited dimensions

Variables                    An array of structures with these fields:

                                  Name                                                                                     Variable name

                                 Dimensions                                                                               Associated dimensions
                                 Size                                                                                            Current variable size
                                 Datatype                                                                                     MATLAB® datatype
                                 Attributes                                                                                    Associated variable attributes
                                  ChunkSize                                                                             Chunk size, if defined. [] otherwise
                                 FillValue                                                                                        Fill value of the variable.
                                 DeflateLevel                                                                             Deflate filter level, if enabled.
                                 Shuffle                                                                                       Shuffle filter enabled flag

Attributes                    An array of global attributes with these fields:

                                   Name                                                                                      Attribute name
                                    Value                                                                                      Attribute value
Groups                      An array of groups present in the file, for netcdf4 files; An empty array ([]) for all other NetCDF file                                               formats.
Format                       The format of the NetCDF file

 

vinfo                                       A structure containing only the variable fields from finfo.

                                              Field                                                       Description
                                             Filename                                                 NetCDF file name
                                              Name                                                     Name of the variable
                                             Dimensions                                              Dimensions of the variable
                                             Size                                                        Size of the current variable
                                             Datatype                                                 MATLAB datatype
                                             Attributes                                                Attributes associated with the variable
                                             ChunkSize                                               Chunk size, if defined. [] otherwise.
                                             FillValue                                                   Fill value used in the variable.
                                             DeflateLevel                                             Deflate filter level, if enabled.
                                             Shuffle                                                     Shuffle filter enabled flag
                                             Format                                                    The format of the NetCDF file

 

Examples

Search for dimensions with names that start with the character x in the file.

finfo = ncinfo('example.nc');
disp(finfo);
dimNames = {finfo.Dimensions.Name};
dimMatch = strncmpi(dimNames,'x',1);
disp(finfo.Dimensions(dimMatch));

 

Obtain the size of a variable and check if it has any unlimited dimensions.

vinfo = ncinfo('example.nc','peaks');
varSize = vinfo.Size;
disp(vinfo);
hasUnLimDim = any([vinfo.Dimensions.Unlimited]);

Find all unlimited dimensions defined in a group.

ginfo = ncinfo('example.nc','/grid2/');
unlimDims = [ginfo.Dimensions.Unlimited];
disp(ginfo.Dimensions(unlimDims));

转载于:https://www.cnblogs.com/zhengtaodoit/p/4931004.html

你可能感兴趣的文章
统计文本单词个数,并个数大小按序排列 C#
查看>>
maven setting仓库镜像
查看>>
如何让HTML的编写更具结构性
查看>>
在实际的运用中,我经常遇到需要对基础表的数据进行筛选后再进行行转列
查看>>
UVALive 6560 The Urge to Merge
查看>>
菜鸟简述Jquery中Ajax发送post请求及XML响应
查看>>
Codeforces Round #269 (Div. 2) D. MUH and Cube Walls KMP
查看>>
HDU 4251 The Famous ICPC Team Again 主席树
查看>>
POJ 2774 Long Long Message 后缀数组
查看>>
datagrid中设置编辑,删除列是否可以访问
查看>>
Linux下I/O复用 Select与Poll
查看>>
python全栈学习--day10(函数进阶)
查看>>
Android初学第19天
查看>>
Flask框架web开发
查看>>
LRU算法
查看>>
MongoDB 系列(一) C# 类似EF语法简单封装
查看>>
ios github网址
查看>>
Django 数据库操作之数据库连接
查看>>
写log
查看>>
Python基础 ----- 流程控制
查看>>