cf.Domain.insert_dimension

Domain.insert_dimension(size, dim=None, replace=True)[source]

Insert a new dimension to the domain in place, preserving internal consistency.

Parameters :
size : int

The size of the new dimension.

dim : str

The identifier for the new dimension, 'dimN'. The N part of the identifier should be replaced by an integer greater then or equal to zero.

replace : bool, optional

If False then do not replace an existing dimension with the same identifier but a different size. By default an existing dimension with the same identifier is changed to have the new size.

Returns :
out : str

The identifier for the new dimension (see the dim parameter).

Examples

>>> d.insert_dimension(1)
>>> d.insert_dimension(90, dim='dim4')
>>> d.insert_dimension(23, dim='dim0', replace=False)

Previous topic

cf.Domain.insert_dim_coordinate

Next topic

cf.Domain.insert_transform

This Page