cf.Field.get_data_axes

Field.get_data_axes(*identity, default=ValueError(), **filter_kwargs)[source]

Gets the keys of the axes spanned by the construct data.

Specifically, returns the keys of the domain axis constructs spanned by the data of the field or of a metadata construct.

New in version (cfdm): 1.7.0

Parameters
identity, filter_kwargs: optional

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

If neither identity nor filter_kwargs are set then the domain of the field construct’s data are returned.

New in version (cfdm): 1.10.0.0

default: optional

Return the value of the default parameter if the data axes have not been set.

If set to an Exception instance then it will be raised instead.

filter_kwargs: optional

Keyword arguments as accepted by Constructs.filter that define additional construct selection criteria.

New in version (cfdm): 1.10.0.0

Returns
tuple

The keys of the domain axis constructs spanned by the data.

Examples

>>> f = cf.example_field(0)
>>> f.get_data_axes()
('domainaxis0', 'domainaxis1')
>>> f.get_data_axes('latitude')
('domainaxis0',)
>>> f.get_data_axes('time')
('domainaxis2',)
>>> f.has_data_axes()
True
>>> f.del_data_axes()
('domainaxis0', 'domainaxis1')
>>> f.has_data_axes()
False
>>> f.get_data_axes(default='no axes')
'no axes'