cf.DimensionCoordinate.override_calendar¶
- DimensionCoordinate.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 theUnits
orcalendar
attributes.See also
override_units
,to_units
,Units
,units
,calendar
- Parameters:
- Returns:
DimensionCoordinate
orNone
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