cf.DimensionCoordinate.period¶
-
DimensionCoordinate.
period
(*value)[source]¶ Set the period for cyclic coordinates.
Parameters: - value: data-like or
None
, optional The period. The absolute value is used.
A data-like scalar object is any object containing scalar data which could be used to create a
cf.Data
object.- Example:
Instances,
x
, of following types are all examples of scalar data-like objects (becausecf.Data(x)
creates a validcf.Data
object):int
,float
,str
, and scalar-valuednumpy.ndarray
,cf.Data
,cf.Coordinate
,cf.Field
.
Returns: Examples: >>> print c.period() None >>> c.Units <CF Units: degrees_east> >>> print c.period(360) None >>> c.period() <CF Data: 360.0 'degrees_east'> >>> import math >>> c.period(cf.Data(2*math.pi, 'radians')) <CF Data: 360.0 degrees_east> >>> c.period() <CF Data: 6.28318530718 radians> >>> c.period(None) <CF Data: 6.28318530718 radians> >>> print c.period() None >>> print c.period(-360) None >>> c.period() <CF Data: 360.0 degrees_east>
- value: data-like or