cf.Field.insert_dim

Field.insert_dim(item, key=None, axes=None, copy=True, replace=True)[source]

Insert a dimension coordinate object into the field.

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

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

axes: sequence of str, optional

The axis for the item. The axis is given by its domain identifier. By default the axis will be the same as the given by the key parameter.

key: str, optional

The identifier for the item. By default a new, unique identifier will be generated.

copy: bool, optional

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

replace: bool, optional

If False then do not replace an existing dimension coordinate object of domain which has the same identifier. By default an existing dimension coordinate object with the same identifier is replaced with item.

Returns:
out:

The identifier for the inserted item.

Examples:
>>>