cf.Field.domain_axis_key

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

Returns the domain axis key spanned by 1-d coordinates.

Specifically, returns the key of the domain axis construct that is spanned by 1-d coordinate constructs.

Parameters
identity: optional

Select the 1-d dimension coordinate constructs that have an identity, defined by their identities methods, that matches any of the given values.

If no values are provided then all 1-d dimension coordinate constructs are selected.

A value may be any object that can match via the == operator, or a re.Pattern object that matches via its search method.

Note that in the output of a dump method or print call, a construct is always described by an identity that will select it.

default: optional

Return the value of the default parameter if there is no unique construct.

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.8.9.0

Returns
str

The key of the domain axis construct that is spanned by the data of the selected 1-d coordinate constructs.

Examples

>>> print(f.constructs())
Constructs:
{'dimensioncoordinate0': <CF DimensionCoordinate: time(1) days since 1964-01-21 00:00:00 >,
 'dimensioncoordinate1': <CF DimensionCoordinate: pressure(23) mbar>,
 'dimensioncoordinate2': <CF DimensionCoordinate: latitude(160) degrees_north>,
 'dimensioncoordinate3': <CF DimensionCoordinate: longitude(320) degrees_east>,
 'domainaxis0': <CF DomainAxis: size(1)>,
 'domainaxis1': <CF DomainAxis: size(23)>,
 'domainaxis2': <CF DomainAxis: size(160)>,
 'domainaxis3': <CF DomainAxis: size(320)>}
>>> f.domain.domain_axis_key('time')
'domainaxis0'
>>> f.domain.domain_axis_key('longitude')
'domainaxis3'