cf.Domain.dim_coords

Domain.dim_coords(dim=None)[source]

Return a dictionary whose values are the dimension coordinates which span the given dimension and keys of the domain’s dimension coordinate identifiers.

Parameters :
dim : str, optional

The identifier of the dimension. By default all dimension coordinates are returned.

Returns :
out : dict

The dimension coordinates and their identifiers.

Examples

>>> d.dimensions
{'data': ['dim0', 'dim1', 'dim2'],
 'dim0': ['dim0'],
 'dim1': ['dim1'],
 'dim2': ['dim2'],
 'dim3': ['dim3'],
 'aux0': ['dim1', 'dim2'],
 'aux1': ['dim0'],
 'aux2': ['dim2', 'dim1']}
>>> d.dim_coords()
{'dim0': <CF Coordinate: ...>,
 'dim1': <CF Coordinate: ...>,
 'dim2': <CF Coordinate: ...>,
 'dim3': <CF Coordinate: ...>}
>>> d.dim_coords('dim2')
{'dim2': <CF Coordinate: ...>}

Previous topic

cf.Domain.copy

Next topic

cf.Domain.direction

This Page