cf.Domain.items

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

Return items of the domain.

This method has exactly the same interface, functionality and outputs as cf.Field.items. Therefore see cf.Field.items for the full documentation details.

See also

axes, item, remove_items

Parameters:
items : optional

See cf.Field.items.

role : (sequence of) str, optional

See cf.Field.items.

axes : optional

See cf.Field.items.

ndim : int or cf.Query, optional

See cf.Field.items.

exact : bool, optional

See cf.Field.items.

inverse : bool, optional

See cf.Field.items.

match_and : bool, optional

See cf.Field.items.

strict_axes : bool, optional

See cf.Field.items.

Returns:
out : dict

See cf.Field.items.

Examples:

See cf.Field.items.

All of these examples are for the same domain, whose complete dictionary of items is shown in the first example.

>>> d.items()
{'dim0': <CF DimensionCoordinate: grid_latitude(111) degrees>,
 'dim1': <CF DimensionCoordinate: grid_longitude(106) degrees>,
 'dim2': <CF DimensionCoordinate: time(12) days since 1997-1-1>,
 'aux0': <CF AuxiliaryCoordinate: longitude(111, 106) degrees_E>,
 'aux1': <CF AuxiliaryCoordinate: latitude(111, 106) degrees_N>,
 'aux2': <CF AuxiliaryCoordinate: forecast_reference_time(12) days since 1997-1-1>
 'msr0': <CF CellMeasure: area(111, 106) m2>,
 'ref0': <CF CoordinateReference: rotated_latitude_longitude>}
>>> d.items(axes='grid_latitude')
{'dim0': <CF DimensionCoordinate: grid_latitude(111) degrees>,
 'aux0': <CF AuxiliaryCoordinate: longitude(111, 106) degrees_E>,
 'aux1': <CF AuxiliaryCoordinate: latitude(111, 106)> degrees_N,
 'msr0': <CF CellMeasure: area(111, 106) m2>}
>>> d.items(axes='grid_latitude', ndim=1)
{'dim0': <CF DimensionCoordinate: grid_latitude(111) degrees>}
>>> d.items(axes='grid_latitude', strict_axes=True)
{'dim0': <CF DimensionCoordinate: grid_latitude(111) degrees>}
>>> d.items(axes='time')
{'dim2': <CF DimensionCoordinate: time(12) days since 1997-1-1>,
 'aux2': <CF AuxiliaryCoordinate: forecast_reference_time(12) days since 1997-1-1>}
>>> d.items(axes='time', role='d')
{'dim2': <CF DimensionCoordinate: time(12) days since 1997-1-1>}
>>> d.items(axes='area')
{'aux0': <CF AuxiliaryCoordinate: longitude(111, 106) degrees_E>,
 'aux1': <CF AuxiliaryCoordinate: latitude(111, 106) degrees_N>,
 'msr0': <CF CellMeasure: area(111, 106) m2>}
>>> d.items(axes=['grid_latitude', 'grid_longitude'])
{'aux0': <CF AuxiliaryCoordinate: longitude(111, 106) degrees_E>,
 'aux1': <CF AuxiliaryCoordinate: latitude(111, 106) degrees_N>,
 'msr0': <CF CellMeasure: area(111, 106) m2>}
>>> d.items('grid')
{'dim0': <CF DimensionCoordinate: grid_latitude(111) degrees>,
 'dim1': <CF DimensionCoordinate: grid_longitude(106) degrees>}
>>> d.items('grid', exact=True)
{}
>>> d.items({'units': 'degrees_E'})
{'dim0': <CF DimensionCoordinate: grid_latitude(111) degrees>,
 'dim1': <CF DimensionCoordinate: grid_longitude(106) degrees>,
 'aux0': <CF AuxiliaryCoordinate: longitude(111, 106) degrees_E>,
 'aux1': <CF AuxiliaryCoordinate: latitude(111, 106)> degrees_N}
>>> d.items({'units': 'degrees_E'}, exact=True)
{'aux0': <CF AuxiliaryCoordinate: longitude(111, 106) degrees_E>}
>>> d.items({'units': 'radians', 'standard_name': 'time'})
{}
>>> d.items({'units': 'radians', 'standard_name': 'time'}, maximal_match=False)
{'dim0': <CF DimensionCoordinate: grid_latitude(111) degrees>,
 'dim1': <CF DimensionCoordinate: grid_longitude(106) degrees>,
 'dim2': <CF DimensionCoordinate: time(12) days since 1997-1-1>,
 'aux0': <CF AuxiliaryCoordinate: longitude(111, 106) degrees_E>,
 'aux1': <CF AuxiliaryCoordinate: latitude(111, 106)> degrees_N}
>>> d.items({'units': 'radians', 'standard_name': 'time'}, maximal_match=False, exact=True)
{'dim2': <CF DimensionCoordinate: time(12) days since 1997-1-1>}
>>> set(d.items(role='da')) == set(d.items(role='ct', inverse=True))
True

Previous topic

cf.Domain.item_axes

Next topic

cf.Domain.map_axes

This Page