Return a coordinate of the domain.
Note that the returned coordinate is an object identity (not a copy) to the coordinate stored in the domain so, for example, a coordinate’s properties may be changed in-place:
>>> f.coord('height').long_name
AttributeError: Coordinate has no CF property 'long_name'
>>> f.coord('height').long_name = 'height'
>>> f.coord('height').long_name
'height'
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> print f
Data : air_temperature(time(12), latitude(73), longitude(96)) K
Cell methods : time: mean
Dimensions : time(12) = [15, ..., 345] days since 1860-1-1
: latitude(73) = [-90, ..., 90] degrees_north
: longitude(96) = [0, ..., 356.25] degrees_east
: height(1) = [2] m
>>> f.domain['dim2'].properties
{'_FillValue': None,
'axis': 'X',
'long_name': 'longitude',
'standard_name': 'longitude',
'units': 'degrees_east'}
>>> f.domain['dim2'].shape
(360,)
>>> f.coord('longitude')
<CF Coordinate: longitude(96)>
>>> f.coord('long')
<CF Coordinate: longitude(96)>
>>> f.coord('long', key=True)
'dim2'
>>> f.coord('long', dimensions=True)
['dim2']
>>> f.coord('long', oned_d=True)
<CF Coordinate: longitude(96)>
>>> f.coord('lon', exact=True)
None
>>> f.coord('longitude', exact=True)
<CF Coordinate: longitude(96)>
>>> f.coord({'standard_name': 'long', 'axis': X})
<CF Coordinate: longitude(96)>
>>> f.coord({'standard_name': 'long', 'axis': 'X'}, maximal_match=False)
<CF Coordinate: longitude(96)>
>>> f.coord({'standard_name': 'long', 'axis': 'Y'})
None
>>> f.coord({'standard_name': 'long', 'axis': 'Y'}, maximal_match=False)
<CF Coordinate: longitude(96)>
>>> f.coord('long', role='dim')
<CF Coordinate: longitude(96)>
>>> f.coord('long', role='aux')
None