cf.CellMeasure.override_calendar

CellMeasure.override_calendar(*args, **kwargs)[source]

Override the calendar of date-time units.

The new calendar need not be equivalent to the original one, and the data array elements will not be changed to reflect the new calendar. Therefore, this method should only be used when it is known that the data array values are correct but the calendar has been incorrectly encoded.

Not to be confused with changing to an equivalent calendar with the to_units method or the Units or calendar attributes.

See also

override_units, to_units, units, Units, calendar

Parameters:
calendar: str

The new calendar.

inplace: bool, optional

If True then do the operation in-place and return None.

i: deprecated at version 3.0.0

Use the inplace parameter instead.

Returns:
CellMeasure or None

The construct with data converted to the new units, or None if the operation was in-place.

Examples

>>> f.Units
<Units: days since 2020-02-28>
>>> print(f.array)
1
>>> g = f.override_calendar('noleap')
>>> g.Units
<Units: days since 2020-02-28 noleap>
>>> print(f.array)
1