cf.Field.domain_axis_position

Field.domain_axis_position(*identity, **filter_kwargs)[source]

Return the position in the data of a domain axis construct.

New in version 3.0.0.

See also

domain_axis

Parameters
identity, filter_kwargs: optional

Select the unique domain axis construct returned by f.domain_axis(*identity, **filter_kwargs). See domain_axis for details.

Returns
int

The position in the field construct’s data of the selected domain axis construct.

Examples:

>>> f
<CF Field: air_temperature(time(12), latitude(64), longitude(128)) K>
>>> f.get_data_axes()
('domainaxis0', 'domainaxis1', 'domainaxis2')
>>> f.domain_axis_position('T')
0
>>> f.domain_axis_position('latitude')
1
>>> f.domain_axis_position('domainaxis1')
1
>>> f.domain_axis_position(2)
2
>>> f.domain_axis_position(-2)
1