Netcdf Toolkit - ncinfo
- Function File:
info =ncinfo(filename) - Function File:
info =ncinfo(filename, varname) - Function File:
info =ncinfo(filename, groupname) Return information about an entire NetCDF file filename (i.e. the root group "/"), about the variable called varname or the group called groupname.
The structure info has always the following fields:
- Filename: the name of the NetCDF file
- Format: one of the strings "CLASSIC", "64BIT", "NETCDF4" or "NETCDF4_CLASSIC"
The structure info has additional fields depending on whether a group of variable is queried.
Groups
Groups are returned as an array structure with the following fields:
- Name: the group name. The root group is named "/".
- Dimensions: a array structure with the dimensions.
- Variables: a array structure with the variables.
- Attributes: a array structure with global attributes.
- Groups: a array structure (one for each group) with the same fields as this structure.
Dimensions
Dimensions are returned as an array structure with the following fields:
- Name: the name of the dimension
- Length: the length of the dimension
- Unlimited: true of the dimension has no fixed limited, false
Variables
Variables are returned as an array structure with the following fields:
- Name: the name of the dimension
- Dimensions: array structure of all dimensions of this variable with the same structure as above.
- Size: array with the size of the variable
- Datatype: string with the corresponding octave data-type (see below)
- Attributes: a array structure of attributes
- FillValue: the NetCDF fill value of the variable. If the fill value is not defined, then this attribute is an empty array ([]).
- DeflateLevel: the NetCDF deflate level between 0 (no compression) and 9 (maximum compression).
- Shuffle: is true if the shuffle filter is activated to improve compression, otherwise false.
- CheckSum: is set to "fletcher32", if check-sums are used, otherwise this field is not defined.
Attributes
Attributes are returned as an array structure with the following fields:
- Name: the name of the attribute
- Value: the value of the attribute (with the corresponding type)
- Unlimited: true of the dimension has no fixed limited, false
Data-types
The following the the correspondence between the Octave and NetCDF data-types:
Octave type NetCDF type int8NC_BYTEuint8NC_UBYTEint16NC_SHORTuint16NC_USHORTint32NC_INTuint32NC_UINTint64NC_INT64uint64NC_UINT64singleNC_FLOATdoubleNC_DOUBLEcharNC_CHARThe output of
ncinfocan be used to create a NetCDF file with the same meta-data usingncwriteschema.Note: If there are no attributes (or variable or groups), the corresponding field is an empty matrix and not an empty struct array for compatibility with matlab.
See also: ncread,nccreate,ncwriteschema,ncdisp.