xarray.coding.times.CFDatetimeCoder#
- class xarray.coding.times.CFDatetimeCoder(use_cftime=None, time_unit='ns')[source]#
Coder for CF Datetime coding.
- Parameters:
use_cftime (
bool, optional) – Only relevant if encoded dates come from a standard calendar (e.g. “gregorian”, “proleptic_gregorian”, “standard”, or not specified). If None (default), attempt to decode times tonp.datetime64objects; if this is not possible, decode times tocftime.datetimeobjects. If True, always decode times tocftime.datetimeobjects, regardless of whether or not they can be represented usingnp.datetime64objects. If False, always decode times tonp.datetime64objects; if this is not possible raise an error. May not be supported by all the backends.time_unit (
PDDatetimeUnitOptions) – Target resolution when decoding dates. Defaults to “ns”.
Methods
__init__([use_cftime, time_unit])decode(variable[, name])Convert a decoded variable to an encoded variable
encode(variable[, name])Convert an encoded variable to a decoded variable