cf.Domain.flip

Domain.flip(axes=None, inplace=False)[source]

Flip (reverse the direction of) domain axes.

Parameters
axes: (sequence of) str , optional

Select the domain axes to flip.

A domain axis is identified by that which would be selected by passing a given axis description to a call of the domain_axis method. For example, a value of 'X' would select the domain axis construct returned by f.domain_axis('X').

If no axes are provided then all axes are flipped.

inplace: bool, optional

If True then do the operation in-place and return None.

Returns
Domain or None

The domain with flipped axes, or None if the operation was in-place.

Examples

>>> d = cf.example_field(0).domain
>>> print(d)
Dimension coords: latitude(5) = [-75.0, ..., 75.0] degrees_north
                : longitude(8) = [22.5, ..., 337.5] degrees_east
                : time(1) = [2019-01-01 00:00:00]
>>> print(d.flip('X'))
Dimension coords: latitude(5) = [-75.0, ..., 75.0] degrees_north
                : longitude(8) = [337.5, ..., 22.5] degrees_east
                : time(1) = [2019-01-01 00:00:00]
>>> print(d.flip(['T', 'Y']))
Dimension coords: latitude(5) = [75.0, ..., -75.0] degrees_north
                : longitude(8) = [22.5, ..., 337.5] degrees_east
                : time(1) = [2019-01-01 00:00:00]
>>> print(d.flip())
Dimension coords: latitude(5) = [75.0, ..., -75.0] degrees_north
                : longitude(8) = [337.5, ..., 22.5] degrees_east
                : time(1) = [2019-01-01 00:00:00]