diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index 5893d8bf46..d665c6ad38 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -50,6 +50,11 @@ Documentation and :py:func:`~pvlib.irradiance.get_sky_diffuse` docstrings. (:issue:`2897`, :pull:`2904`) +* Document in :py:func:`pvlib.iotools.read_epw` that each record is labeled + with the start of its hour, unlike :py:func:`pvlib.iotools.read_tmy3`, and + how to label it with the time given in the EPW file. (:issue:`1156`, + :pull:`2894`) + Testing ~~~~~~~ @@ -80,3 +85,4 @@ Contributors * :ghuser:`bfs2021` * :ghuser:`xiajiahang` * Jakub Krasuski (:ghuser:`Blizzeq`) +* Christoph Deil (:ghuser:`cdeil`) diff --git a/pvlib/iotools/epw.py b/pvlib/iotools/epw.py index 01c87c180a..3be36bdbff 100644 --- a/pvlib/iotools/epw.py +++ b/pvlib/iotools/epw.py @@ -209,6 +209,19 @@ def read_epw(filename, coerce_year=None): +-------------------------------+-----------------------------------------+ + .. warning:: In hourly EPW files, radiation totals and illuminance + averages cover the hour *ending* at the file time; temperature, + humidity and pressure are values *at* that time [1]_. + ``read_epw`` labels all fields with the *start* of the hour (EPW + hour 1 becomes 00:00), while :py:func:`~pvlib.iotools.read_tmy3` + uses the *end*. + + To use end-of-hour labels, add one hour to the index: + ``data.index = data.index + pd.Timedelta('1h')``. The record for + 31 December's final hour then has the label 1 January 00:00 of + the following year. No records are added or removed. + + References ----------