Return items of the domain.
See also
Parameters: | {+items} {+role} {+axes} {+axes_all} {+axes_subset} {+axes_superset} {+ndim} {+exact} {+match_and} {+inverse} {+copy} |
---|---|
Returns: |
|
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