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 typeNetCDF type
int8NC_BYTE
uint8NC_UBYTE
int16NC_SHORT
uint16NC_USHORT
int32NC_INT
uint32NC_UINT
int64NC_INT64
uint64NC_UINT64
singleNC_FLOAT
doubleNC_DOUBLE
charNC_CHAR

The output of ncinfo can be used to create a NetCDF file with the same meta-data using ncwriteschema.

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.

Package: netcdf