Skip to content

Commit

Permalink
Add documentation for features.clearsky to API docs
Browse files Browse the repository at this point in the history
Also add attribution in liscences file.
  • Loading branch information
wfvining committed Apr 16, 2020
1 parent 0ab6f18 commit 6ef7624
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Functions for detecting features in the data.
:toctree: generated/

features.clipping_levels
features.clearsky

.. rubric:: References

Expand Down
5 changes: 4 additions & 1 deletion docs/licenses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ the terms of the MIT License

* The implementation of the QCRad algorithm in
:py:mod:`pvanalytics.quality.irradiance`

* The clearsky limits quality check
:py:func:`pvanalytics.quality.irradiance.clearsky_limits`

Expand All @@ -49,3 +49,6 @@ the terms of the MIT License

* Level-based clipping detection in
:py:func:`pvanalytics.features.clipping_levels`.

* Clear sky detection in
:py:func:`pvanalytics.features.clearsky`
32 changes: 32 additions & 0 deletions pvanalytics/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,38 @@ def clearsky(ghi, ghi_clearsky):
Global horizontal irradiance in :math:`W/m^2` under clearsky
conditions.
Returns
-------
Series
True when clear sky conditions are indicated.
Raises
------
ValueError
if the time intervals are greater than 15 minutes.
Notes
-----
Clear-sky conditions are inferred when each of six criteria are
met; see :py:func:`pvlib.clearsky.detect_clearsky` for references
and details. Threshold values for each criterion were originally
developed for ten minute windows containing one-minute data
[1]_. As indicated in [2]_, the algorithm also works for longer
windows and data at different intervals if threshold criteria are
roughly scaled to the window length. Here, the threshold values
are based on [1] with the scaling indicated in [2].
References
----------
.. [1] Reno, M.J. and C.W. Hansen, "Identification of periods of
clear sky irradiance in time series of GHI measurements"
Renewable Energy, v90, p. 520-531, 2016.
.. [2] B. H. Ellis, M. Deceglie and A. Jain, "Automatic Detection
of Clear-Sky Periods From Irradiance Data," in IEEE Journal of
Photovoltaics, vol. 9, no. 4, pp. 998-1005, July 2019. doi:
10.1109/JPHOTOV.2019.2914444
"""
delta = ghi.index.to_series().diff()
delta_minutes = delta[1] / np.timedelta64(1, '60s')
Expand Down

0 comments on commit 6ef7624

Please sign in to comment.