Skip to content

Commit

Permalink
fix time-coding.rst, add reference to time-series.rst.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Jan 9, 2025
1 parent 4525ea1 commit 0b93dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/internals/time-coding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ CF time decoding

Decoding of ``values`` with a time unit specification like ``"seconds since 1992-10-8 15:15:42.5 -6:00"`` into datetimes using the CF conventions is a multistage process.

1. If we have a non-standard calendar (e.g. ``"noleap"``) decoding is done with the ``cftime`` package, which is not covered in this section. For the``"standard"``/``"gregorian"`` calendar as well as the ``"proleptic_gregorian"`` calendar the above outlined pandas functionality is used.
1. If we have a non-standard calendar (e.g. ``"noleap"``) decoding is done with the ``cftime`` package, which is not covered in this section. For the ``"standard"``/``"gregorian"`` calendar as well as the ``"proleptic_gregorian"`` calendar the above outlined pandas functionality is used.

2. The ``"standard"``/``"gregorian"`` calendar and the ``"proleptic_gregorian"`` are equivalent for any dates and reference times >= ``"1582-10-15"``. First the reference time is checked and any timezone information stripped off. In a second step, the minimum and maximum ``values`` are checked if they can be represented in the current reference time resolution. At the same time integer overflow would be caught. For the ``"standard"``/``"gregorian"`` calendar the dates are checked to be >= ``"1582-10-15"``. If anything fails, the decoding is attempted with ``cftime``.

Expand Down
3 changes: 2 additions & 1 deletion doc/user-guide/time-series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ using :py:func:`pandas.to_datetime` and :py:func:`pandas.date_range`:
For :py:func:`pandas.date_range` the ``unit``-kwarg has to be specified
and for :py:func:`pandas.to_datetime` the selection of the resolution
isn't possible at all. For that :py:class:`pd.DatetimeIndex` can be used
directly.
directly. There is more in-depth information in section
:ref:`<internals.timecoding>`.

Alternatively, you can supply arrays of Python ``datetime`` objects. These get
converted automatically when used as arguments in xarray objects (with us-resolution):
Expand Down

0 comments on commit 0b93dbd

Please sign in to comment.