cf.DomainAxis


class cf.DomainAxis(size=None, source=None, copy=True)[source]

Bases: cfdm.domainaxis.DomainAxis

A domain axis construct of the CF data model.

A domain axis construct specifies the number of points along an independent axis of the domain. It comprises a positive integer representing the size of the axis. In CF-netCDF it is usually defined either by a netCDF dimension or by a scalar coordinate variable, which implies a domain axis of size one. The field construct’s data array spans the domain axis constructs of the domain, with the optional exception of size one axes, because their presence makes no difference to the order of the elements.

NetCDF interface

The netCDF dimension name of the construct may be accessed with the nc_set_dimension, nc_get_dimension, nc_del_dimension and nc_has_dimension methods.

Initialization

Parameters:
size: int, optional

The size of the domain axis.

Parameter example:

size=192

The size may also be set after initialisation with the set_size method.

source: optional

Initialize the size from that of source.

copy: bool, optional

If False then do not deep copy input parameters prior to initialization. By default arguments are deep copied.

Inspection

Methods

identity Return the canonical identity.
identities Return all possible identities.

Attributes

construct_type Return a description of the construct type.

Size

Methods

del_size Remove the size.
has_size Whether the size has been set.
get_size Return the size.
set_size Set the size.

Attributes

size TODO

Miscellaneous

Methods

copy Return a deep copy.
equals Whether two domain axis constructs are the same.
inspect Inspect the object for debugging.

NetCDF

Methods

nc_del_dimension Remove the netCDF dimension name.
nc_get_dimension Return the netCDF dimension name.
nc_has_dimension Whether the netCDF dimension name has been set.
nc_set_dimension Set the netCDF dimension name.
nc_is_unlimited Inspect the unlimited status of the a netCDF dimension.
nc_set_unlimited Set the unlimited status of the a netCDF dimension.

Arithmetic and comparison operations

Arithmetic, bitwise and comparison operations are defined on a field construct as element-wise operations on its data which yield a new field construct or, for augmented assignments, modify the field construct’s data in-place.

Comparison operators

__lt__ The rich comparison operator <
__le__ The rich comparison operator <=
__eq__ The rich comparison operator ==
__ne__ The rich comparison operator !=
__gt__ The rich comparison operator >
__ge__ The rich comparison operator >=

Binary arithmetic operators

__add__ The binary arithmetic operation +
__sub__ The binary arithmetic operation -

Binary arithmetic operators with reflected (swapped) operands

__radd__ The binary arithmetic operation + with reflected operands

Augmented arithmetic assignments

__iadd__ The augmented arithmetic assignment +=
__isub__ The augmented arithmetic assignment -=

Unary arithmetic operators

__int__ TODO

Special

Methods

__deepcopy__ Called by the copy.deepcopy function.
__hash__ TODO
__repr__ Called by the repr built-in function.
__str__ Called by the str built-in function.