cf.Domain.coordinates

Domain.coordinates(dim=None)[source]

Return a dictionary mapping coordinate identifiers to their coordinates.

Parameters :
dim : str, optional

Only selects coordinates which span this dimension, defined by its domain identifier.

Returns :
out : dict

A dictionary whose keys are coordinate identifiers and values are their coordinates.

Examples

>>> d.dimensions
{'aux0': ['dim0'],
 'aux1': ['dim0'],
 'aux2': ['dim2', 'dim1'],
 'aux3': ['dim1', 'dim2'],
 'cm0' : ['dim1', 'dim2'],
 'data': ['dim0', 'dim1', 'dim2'],
 'dim0': ['dim0'],
 'dim1': ['dim1'],
 'dim2': ['dim2']}
>>> d.coordinates()
{'aux0': <CF Coordinate: atmosphere_hybrid_height_coordinate_ak(1) m>,
 'aux1': <CF Coordinate: atmosphere_hybrid_height_coordinate_bk(1)>,
 'aux2': <CF Coordinate: latitude(10, 9) degree_N>,
 'aux3': <CF Coordinate: longitude(9, 10) degreesE>,
 'dim0': <CF Coordinate: atmosphere_hybrid_height_coordinate(1)>,
 'dim1': <CF Coordinate: grid_longitude(9) degrees_east>,
 'dim2': <CF Coordinate: grid_latitude(10) degrees_north>}
>>> d.coordinates('dim1')
{'aux2': <CF Coordinate: latitude(10, 9) degree_N>,
 'aux3': <CF Coordinate: longitude(9, 10) degreesE>,
 'dim1': <CF Coordinate: grid_longitude(9) degrees_east>}

Previous topic

cf.Domain.coord

Next topic

cf.Domain.copy

This Page