Variable

class metpy.io.cdm.Variable(**kwargs)[source]

Holds typed data (using a numpy.ndarray), as well as attributes (e.g. units).

In addition to its various attributes, the Variable supports getting and setting data using the [] operator and indices or slices. Getting data returns numpy.ndarray instances.

Attributes Summary

datatype

Describes the layout of each element of the data.

dimensions

all the names of Dimension used by this Variable.

dtype

Describes the layout of each element of the data.

name

the name of the variable.

ndim

the number of dimensions used by this variable.

shape

Describes the size of the Variable along each of its dimensions.

size

the total number of elements.

Methods Summary

__init__(**kwargs)

group()

Get the Group that owns this Variable.

ncattrs()

Get a list of the names of the netCDF attributes.

Attributes Documentation

datatype

Describes the layout of each element of the data.

Type

numpy.dtype

dimensions

all the names of Dimension used by this Variable.

Type

tuple[str]

dtype

Describes the layout of each element of the data.

Type

numpy.dtype

name

the name of the variable.

Type

str

ndim

the number of dimensions used by this variable.

Type

int

shape

Describes the size of the Variable along each of its dimensions.

Type

tuple[int]

size

the total number of elements.

Type

int

Methods Documentation

__init__(**kwargs)
group()[source]

Get the Group that owns this Variable.

Returns

Group – The parent Group.

ncattrs()

Get a list of the names of the netCDF attributes.

Returns

List[str]