Skip to content

Commit 36744dc

Browse files
committed
revise error, add POA to docstring
1 parent 369cb0c commit 36744dc

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

pvlib/clearsky.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -683,22 +683,26 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
683683
var_diff=0.005, slope_dev=8, max_iterations=20,
684684
return_components=False):
685685
"""
686-
Detects clear sky times according to the algorithm developed by Reno
687-
and Hansen for GHI measurements. The algorithm [1]_ was designed and
688-
validated for analyzing GHI time series only. Users may attempt to
689-
apply it to other types of time series data using different filter
690-
settings, but should be skeptical of the results.
686+
Detects clear sky times using the algorithm developed by Reno
687+
and Hansen.
691688
692-
The algorithm detects clear sky times by comparing statistics for a
689+
The algorithm [1]_ was designed and
690+
validated for analyzing GHI time series. Jordan and Hansen [2]_ extended
691+
the algorithm to plane-of-array (POA) irradiance measurements.
692+
693+
The algorithm [1]_ detects clear sky times by comparing statistics for a
693694
measured time series and an expected clearsky time series.
694695
Statistics are calculated using a sliding time window (e.g., 10
695696
minutes). An iterative algorithm identifies clear periods, uses the
696697
identified periods to estimate bias in the clearsky data, scales the
697-
clearsky data and repeats.
698+
clearsky data and repeats
698699
699-
Clear times are identified by meeting 5 criteria. Default values for
700+
Clear times are identified by meeting five criteria. Default values for
700701
these thresholds are appropriate for 10 minute windows of 1 minute
701-
GHI data.
702+
GHI data. For data at longer intervals, it is recommended
703+
to set ``infer_limits=True`` to use the thresholds from [2]_.
704+
705+
For POA data, ``clearsky`` must be on the same plane as ``measured``.
702706
703707
Parameters
704708
----------
@@ -723,8 +727,6 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
723727
clearsky values in each interval, see Eq. 7 in [1]. [W/m2]
724728
lower_line_length : float, default -5
725729
Lower limit of line length criterion from Eq. 8 in [1].
726-
Criterion satisfied when lower_line_length < line length difference
727-
< upper_line_length.
728730
upper_line_length : float, default 10
729731
Upper limit of line length criterion from Eq. 8 in [1].
730732
var_diff : float, default 0.005
@@ -736,7 +738,7 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
736738
change in successive values, see Eqs. 12 through 14 in [1].
737739
max_iterations : int, default 20
738740
Maximum number of times to apply a different scaling factor to
739-
the clearsky and redetermine clear_samples. Must be 1 or larger.
741+
the clearsky and redetermine ``clear_samples``. Must be 1 or larger.
740742
return_components : bool, default False
741743
Controls if additional output should be returned. See below.
742744
@@ -751,7 +753,7 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
751753
for each condition. Only provided if return_components is True.
752754
753755
alpha : scalar, optional
754-
Scaling factor applied to the clearsky_ghi to obtain the
756+
Scaling factor applied to the ``clearsky_ghi`` to obtain the
755757
detected clear_samples. Only provided if return_components is
756758
True.
757759
@@ -820,10 +822,8 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
820822
raise ValueError(f"Samples per window of {samples_per_window}"
821823
" found. Each window must contain at least 3 data"
822824
" points."
823-
" Samples per window is calculated from window_length"
824-
f" ({window_length} found) and the data interval"
825-
f" ({sample_interval} found)."
826-
" Increase window_length.")
825+
f" Window length of {window_length} found; increase"
826+
f" window length to {3*sample_interval} or longer.")
827827

828828
# if infer_limits, find threshold values using the sample interval
829829
if infer_limits:

0 commit comments

Comments
 (0)