Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.16.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Documentation
* Note deprecation of ``king`` model in :py:func:`~pvlib.irradiance.get_total_irradiance`
and :py:func:`~pvlib.irradiance.get_sky_diffuse` docstrings.
(:issue:`2897`, :pull:`2904`)
* Document time index conventions for NSRDB PSM4, PVGIS, CAMS, Solargis,
BSRN, SURFRAD, SOLRAD, and MIDC readers. (:issue:`2963`)


Testing
Expand Down Expand Up @@ -87,3 +89,4 @@ Contributors
* :ghuser:`xiajiahang`
* Jakub Krasuski (:ghuser:`Blizzeq`)
* Dylan Pulver (:ghuser:`dylanpulver`)
* :ghuser:`maoji-y`
5 changes: 3 additions & 2 deletions pvlib/iotools/bsrn.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ def get_bsrn(station, start, end, username, password,
-------
data: DataFrame
timeseries data from the BSRN archive, see
:func:`pvlib.iotools.read_bsrn` for fields. An empty DataFrame is
returned if no data was found for the time period.
:func:`pvlib.iotools.read_bsrn` for fields. The UTC index labels the
start of each measurement interval. An empty DataFrame is returned if
no data was found for the requested dates.
metadata: dict
metadata for the last available monthly file.

Expand Down
5 changes: 3 additions & 2 deletions pvlib/iotools/midc.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ def read_midc_raw_data_from_nrel(site, start, end, variable_map={},

Returns
-------
data:
Dataframe with DatetimeIndex localized to the station location.
data : pandas.DataFrame
DataFrame indexed by the timestamps in the raw data, localized to
the time zone specified in the file header.

Raises
------
Expand Down
24 changes: 17 additions & 7 deletions pvlib/iotools/psm4.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
Returns
-------
data : pandas.DataFrame
timeseries data from NLR PSM4
Time series indexed by the timestamps supplied by NSRDB. See
:func:`~pvlib.iotools.read_nsrdb_psm4` for how the index is built.
metadata : dict
metadata from NLR PSM4 about the record, see
:func:`pvlib.iotools.read_nsrdb_psm4` for fields
Expand Down Expand Up @@ -269,7 +270,8 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy',
Returns
-------
data : pandas.DataFrame
timeseries data from NLR PSM4
Time series indexed by the timestamps supplied by NSRDB. See
:func:`~pvlib.iotools.read_nsrdb_psm4` for how the index is built.
metadata : dict
metadata from NLR PSM4 about the record, see
:func:`pvlib.iotools.read_nsrdb_psm4` for fields
Expand Down Expand Up @@ -401,7 +403,8 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year,
Returns
-------
data : pandas.DataFrame
timeseries data from NLR PSM4
Time series indexed by the timestamps supplied by NSRDB. See
:func:`~pvlib.iotools.read_nsrdb_psm4` for how the index is built.
metadata : dict
metadata from NLR PSM4 about the record, see
:func:`pvlib.iotools.read_nsrdb_psm4` for fields
Expand Down Expand Up @@ -534,7 +537,8 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
Returns
-------
data : pandas.DataFrame
timeseries data from NLR PSM4
Time series indexed by the timestamps supplied by NSRDB. See
:func:`~pvlib.iotools.read_nsrdb_psm4` for how the index is built.
metadata : dict
metadata from NLR PSM4 about the record, see
:func:`pvlib.iotools.read_nsrdb_psm4` for fields
Expand Down Expand Up @@ -674,7 +678,8 @@ def get_nsrdb_psm4_polar(latitude, longitude, api_key, email,
Returns
-------
data : pandas.DataFrame
timeseries data from NLR PSM4 Polar
Time series indexed by the timestamps supplied by NSRDB. See
:func:`~pvlib.iotools.read_nsrdb_psm4` for how the index is built.
metadata : dict
metadata from NLR PSM4 about the record, see
:func:`pvlib.iotools.read_nsrdb_psm4` for fields
Expand Down Expand Up @@ -817,7 +822,8 @@ def get_nsrdb_psm4_polar_tmy(latitude, longitude, api_key, email, year='tmy',
Returns
-------
data : pandas.DataFrame
timeseries data from NLR PSM4 Polar TMY
Time series indexed by the timestamps supplied by NSRDB. See
:func:`~pvlib.iotools.read_nsrdb_psm4` for how the index is built.
metadata : dict
metadata from NLR PSM4, see
:func:`pvlib.iotools.read_nsrdb_psm4` for fields
Expand Down Expand Up @@ -912,7 +918,11 @@ def read_nsrdb_psm4(filename, map_variables=True):
Returns
-------
data : pandas.DataFrame
timeseries data from NLR PSM4
Time series indexed by the file's ``Year``, ``Month``, ``Day``,
``Hour``, and ``Minute`` columns, localized using its ``Time Zone``
metadata. The positions of these timestamps within the hour can vary
with dataset and resolution. For example, hourly Polar single-year
files can use ``HH:00`` and hourly Polar TMY files can use ``HH:30``.
metadata : dict
metadata from NLR PSM4 about the record, see notes for fields

Expand Down
17 changes: 13 additions & 4 deletions pvlib/iotools/pvgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
Returns
-------
data : pandas.DataFrame
Time-series of hourly data, see Notes for fields
Hourly data indexed by the PVGIS timestamps in UTC. The irradiance
timestamp depends on the radiation database. For PVGIS-SARAH it
is the time of the satellite observation at the site. For PVGIS-ERA5
the irradiance is averaged over the hour and labeled at ``HH:30``
[5]_. See Notes for fields.
metadata : dict
Dictionary containing metadata

Expand Down Expand Up @@ -205,6 +209,8 @@ def get_pvgis_hourly(latitude, longitude, start=None, end=None,
<https://joint-research-centre.ec.europa.eu/photovoltaic-geographical-information-system-pvgis/getting-started-pvgis/api-non-interactive-service_en>`_
.. [4] `PVGIS horizon profile tool
<https://ec.europa.eu/jrc/en/PVGIS/tools/horizon>`_
.. [5] `PVGIS 5 user manual, hourly radiation data
<https://joint-research-centre.ec.europa.eu/photovoltaic-geographical-information-system-pvgis/using-pvgis-5/pvgis-5-user-manual_en>`_
""" # noqa: E501
# use requests to format the query string by passing params dictionary
params = {'lat': latitude, 'lon': longitude, 'outputformat': outputformat,
Expand Down Expand Up @@ -486,7 +492,9 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
Returns
-------
data : pandas.DataFrame
the weather data
Hourly weather data. CSV and JSON use ``HH:00`` index labels. See the
irradiance time offset [2]_ for the underlying irradiance timestamp.
For EPW, see :func:`~pvlib.iotools.read_epw` for index parsing.
metadata : list or dict
file metadata

Expand All @@ -504,10 +512,11 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
References
----------
.. [1] `PVGIS <https://ec.europa.eu/jrc/en/pvgis>`_
.. [2] `PVGIS TMY tool <https://ec.europa.eu/jrc/en/PVGIS/tools/tmy>`_
.. [2] `PVGIS TMY tool
<https://joint-research-centre.ec.europa.eu/photovoltaic-geographical-information-system-pvgis/using-pvgis-5/pvgis-5-tools/pvgis-typical-meteorological-year-tmy-generator_en>`_
.. [3] `PVGIS horizon profile tool
<https://ec.europa.eu/jrc/en/PVGIS/tools/horizon>`_
"""
""" # noqa: E501
# use requests to format the query string by passing params dictionary
params = {'lat': latitude, 'lon': longitude, 'outputformat': outputformat}
# pvgis only likes 0 for False, and 1 for True, not strings, also the
Expand Down
7 changes: 5 additions & 2 deletions pvlib/iotools/sodapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
Returns
-------
data: pandas.DataFrame
Timeseries data, see Notes for columns
Time series data indexed by the start (``label='left'``) or end
(``label='right'``) of the observation interval. Daily and monthly
data use dates without a timezone. For monthly data, ``label='right'``
(the default) uses the last day of the month. See Notes for columns.
metadata: dict
Metadata of the requested time-series

Expand All @@ -120,7 +123,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
======================== ====== =========================================
**Mapped field names are returned when the map_variables argument is True**
---------------------------------------------------------------------------
Observation period str Beginning/end of time period
Observation period str Start and end of the observation interval
TOA, ghi_extra float Horizontal radiation at top of atmosphere
Clear sky GHI, ghi_clear float Clear sky global radiation on horizontal
Clear sky BHI, bhi_clear float Clear sky beam radiation on horizontal
Expand Down
4 changes: 3 additions & 1 deletion pvlib/iotools/solargis.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def get_solargis(latitude, longitude, start, end, variables, api_key,
Returns
-------
data : DataFrame
DataFrame containing time series data.
Time series indexed by timestamps from the Solargis API.
``timestamp_type`` selects the start, center (default), or end of
each interval.
meta : dict
Dictionary containing metadata.

Expand Down
3 changes: 2 additions & 1 deletion pvlib/iotools/solrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ def get_solrad(station, start, end,
Returns
-------
data : pd.DataFrame
Dataframe with data from SOLRAD.
Time series with a UTC index. Each timestamp marks the end of the
averaging interval [2]_.
meta : dict
Metadata.

Expand Down
7 changes: 5 additions & 2 deletions pvlib/iotools/surfrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ def get_surfrad(station, start, end, map_variables=True,
Returns
-------
data : pd.DataFrame
Dataframe with data from SURFRAD.
Time series with a UTC index. Each timestamp marks the end of the
averaging interval [4]_.
meta : dict
Metadata.

Expand All @@ -242,7 +243,9 @@ def get_surfrad(station, start, end, map_variables=True,
`SURFRAD Archive <ftp://aftp.cmdl.noaa.gov/data/radiation/surfrad/>`_
.. [3] `NOAA SURFRAD HTTP Index
<https://gml.noaa.gov/aftp/data/radiation/surfrad/>`_
"""
.. [4] `NOAA SURFRAD data format
<https://gml.noaa.gov/aftp/data/radiation/surfrad/Bondville_IL/README_SURFRAD.txt>`_
""" # noqa: E501
start = pd.to_datetime(start)
end = pd.to_datetime(end)

Expand Down