cf.Units

class cf.Units(**kwargs)

Bases: object

A simple, as yet not fully specified, container for CF units and calendar information.

Parameters:**kwargs

The ‘units’ and ‘calendar’ attributes may be set with keyword parameters.

Special attributes:

Attribute Description
calendar The calendar of time units
units The units string

Examples:

>>> u = cf.Units(units='days since 2000-1-1', calendar='standard')
>>> u
<CF Units:units='days since 2000-1-1', calendar='standard'>
>>> u.units
'days since 2000-1-1'
>>> u.calendar
'standard'
>>> u == u
True
>>> u.equals(u)
True

Methods and attributes defined here:

equals(other, rtol=None, atol=None)

Return True if two instances are congruent in that they have

  1. Equal units attributes (if set)
  2. Equal calendar attributes (if set)

Equality of numbers is to within a tolerance. Refer to cf for details.

Parameters:
  • other (object) – The variable to compare against for equality.
  • atol (None or float) – Optional. If None then use the default method for setting the absolute tolerance for equality of real numbers (refer to cf for details). If a float then set the absolute tolerance to this value for all comparisons (refer to the override parameter).
  • rtol (None or float) – Optional. If None then use the default method for setting the relative tolerance for equality of real numbers (refer to cf for details). If a float then set the relative tolerance to this value for all comparisons (refer to the override parameter).
Returns:

True if the two objects are congruent, False otherwise.

Previous topic

cf.CellMethods

Next topic

cf.Data

This Page