cf.Field.period

Field.period(axis, **kwargs)[source]

Return the period of a potentially cyclic axis.

Note that a non-cyclic axis may have a defined period.

Parameters :
axis, kwargs :

Select the unique axis which would be selected by this call of the field’s axes method: f.axes(axis, **kwargs). See cf.Field.axes for details.

Returns :
out : cf.Data or None

The period of the cyclic axis’s dimension coordinates. None is returned if no period has been set.

Examples

>>> f.cyclic()
[]
>>> print f.period('X')
None
>>> f.dim('X').Units
<CF Units: degrees_east>
>>> f.cyclic('X', period=360)
[]
>>> print f.period('X')
<CF Data: 360.0 'degrees_east'>
>>> f.cyclic('X', False)
['dim3']
>>> print f.period('X')
<CF Data: 360.0 'degrees_east'>
>>> f.dim('X').period(None)
<CF Data: 360.0 'degrees_east'>
>>> print f.period('X')
None

Previous topic

cf.Field.override_units

Next topic

cf.Field.remove_axes

This Page