cf.Field.item

Field.item(items=None, role=None, axes=None, exact=False, inverse=False, match_and=True, ndim=None, strict_axes=False, key=False)[source]

Return an item, or its domain identifier, from the field.

An item is either a dimension coordinate, an auxiliary coordinate, a cell measure or a coordinate reference object.

The item is selected with the keyword parameters. When multiple criteria are given, the item will be the intersection of the selections. If no unique item can be found then None is returned.

A returned item is not a copy, so in-place changes to it are stored in the domain.

To find multiple items, use cf.Field.items.

Parameters:
items : optional

Select the item whose properties satisfy the given conditions. Set as for the items parameter of cf.Field.items.

role : (sequence of) str, optional

Select the item of the given roles. Set as for the role parameter of cf.Field.items.

axes : optional

Select the item which span at least one of the specified axes, taken in any order (as well as possibly spanning other, unspecified axes). Set as for the axes parameter of cf.Field.items.

ndim : optional

Select the item whose number of data array axes satisfy the given condition. Set as for the ndim parameter of cf.Field.items.

exact : bool, optional

The exact parameter applies to the interpretation of conditions given by the items parameter. Set as for the exact parameter of cf.Field.items.

inverse : bool, optional

If True then select the item other than those selected by all other criteria.

match_and : bool, optional

Set as for the match_and parameter of cf.Field.items.

strict_axes : bool, optional

The strict_axes argument applies to the interpretation of strict_axes argument. Set as for the axes parameter of cf.Field.items.

key : bool, optional

If True then return the domain’s identifier for the item, rather than the item itself.

Returns:
out :

The unique item or its domain identifier or, if there is no unique item, None.

Examples:

Previous topic

cf.Field.iscyclic

Next topic

cf.Field.item_axes

This Page