cf.Field.axis

Field.axis(axis=None, size=None, ordered=False, **kwargs)[source]

Return a domain axis identifier.

New in version 1.0.

Parameters:
axis, size, kwargs : optional

Select the unique axis which would be selected by this call of the field’s axes method: f.axes(axis, size=size, **kwargs). See cf.Field.axes for details.

ordered : bool, optional

Ignored. Provides compatability with the cf.Field.axes interface.

Returns:
out : str or None

The domain identifier of the unique axis or, if there isn’t one, None.

Examples:
>>> f
<CF Field: air_temperature(time(12), latitude(64), longitude(128)) K>
>>> f.data_axes()
['dim0', 'dim1', 'dim2']
>>> f.axis('time')
'dim0'
>>> f.axis('Y')
'dim1'
>>> f.axis(size=64)
'dim1'
>>> f.axis('X', size=128)
'dim2'
>>> print f.axis('foo')
None
>>> print f.axis('T', size=64)
None

Previous topic

cf.Field.axes_sizes

Next topic

cf.Field.axis_name

This Page