cf.Domain.insert_dim

Domain.insert_dim(item, key=None, axis=None, copy=True, replace=True)[source]

Insert a dimension coordinate to the domain in place.

Parameters:
item: cf.DimensionCoordinate or cf.Coordinate or cf.AuxiliaryCoordinate

The new coordinate. If not a dimension coordinate object then it will be converted to one.

axis : str, optional

key
: str, optional

The identifier for the new dimension coordinate. The identifier is of the form 'dimN' where the N part should be replaced by an arbitrary integer greater then or equal to zero. By default a unique identifier will be generated.

copy: bool, optional

If False then the dimension coordinate is not copied before insertion. By default it is copied.

replace
: bool, optional

If False then do not replace an existing dimension coordinate with the same identifier. By default an existing dimension coordinate with the same identifier is replaced with coord.

Returns:
out
: str

The identifier for the new dimension coordinate (see the key parameter).

Examples:
>>>