cfdm.DomainAxis


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

Bases: cfdm.mixin.netcdf.NetCDFDimension, cfdm.mixin.netcdf.NetCDFUnlimitedDimension, cfdm.mixin.container.Container, cfdm.core.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.

Whether or not the netCDF is unlimited may be accessed with the nc_is_unlimited and nc_set_unlimited methods.

The netCDF dimension group structure may be accessed with the nc_set_dimension, nc_get_dimension, nc_dimension_groups, nc_clear_dimension_groups, and nc_set_dimension_groups methods.

New in version (cfdm): 1.7.0

Initialisation

Parameters
size: int, optional

The size of the domain axis.

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

Parameter example:

size=192

source: optional

Convert source, which can be any type of object, to a DomainAxis instance.

All other parameters, apart from copy, are ignored and their values are instead inferred from source by assuming that it has the DomainAxis API. Any parameters that can not be retrieved from source in this way are assumed to have their default value.

Note that if x is also a DomainAxis instance then cfdm.DomainAxis(source=x) is equivalent to x.copy().

copy: bool, optional

If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not 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.

Miscellaneous

Methods

copy

Return a deep copy.

creation_commands

Returns the commands to create the domain axis construct.

equals

Whether two domain axis constructs are the same.

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.

Groups

Methods

nc_dimension_groups

Return the netCDF dimension group hierarchy.

nc_clear_dimension_groups

Remove the netCDF dimension group hierarchy.

nc_set_dimension_groups

Set the netCDF dimension group hierarchy.

Special

Methods

__deepcopy__

Called by the copy.deepcopy function.

__repr__

Called by the repr built-in function.

__str__

Called by the str built-in function.

Docstring substitutions

Methods

_docstring_special_substitutions

Return the special docstring substitutions.

_docstring_substitutions

Returns the substitutions that apply to methods of the class.

_docstring_package_depth

Returns the class {{package}} substitutions package depth.

_docstring_method_exclusions

Returns method names excluded in the class substitutions.