Skip to content

Commit 9fa9fdc

Browse files
committed
clearsky.py: detect_clearsky
also updated units
1 parent 37d17b8 commit 9fa9fdc

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pvlib/clearsky.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ def _clearsky_get_threshold(sample_interval):
677677
upper_line_length, var_diff, slope_dev)
678678

679679

680-
def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
680+
def detect_clearsky(measured, ghi_clear, times=None, infer_limits=False,
681681
window_length=10, mean_diff=75, max_diff=75,
682682
lower_line_length=-5, upper_line_length=10,
683683
var_diff=0.005, slope_dev=8, max_iterations=20,
@@ -703,9 +703,9 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
703703
Parameters
704704
----------
705705
measured : array or Series
706-
Time series of measured GHI. [W/m2]
707-
clearsky : array or Series
708-
Time series of the expected clearsky GHI. [W/m2]
706+
Time series of measured GHI. [Wm⁻²]
707+
ghi_clear : array or Series
708+
Time series of the expected clearsky GHI. [Wm⁻²]
709709
times : DatetimeIndex, optional
710710
Times of measured and clearsky values. If not specified, the index of
711711
``measured`` will be used.
@@ -717,10 +717,10 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
717717
periods.
718718
mean_diff : float, default 75
719719
Threshold value for agreement between mean values of measured
720-
and clearsky in each interval, see Eq. 6 in [1]. [W/m2]
720+
and clearsky in each interval, see Eq. 6 in [1]. [Wm⁻²]
721721
max_diff : float, default 75
722722
Threshold value for agreement between maxima of measured and
723-
clearsky values in each interval, see Eq. 7 in [1]. [W/m2]
723+
clearsky values in each interval, see Eq. 7 in [1]. [Wm⁻²]
724724
lower_line_length : float, default -5
725725
Lower limit of line length criterion from Eq. 8 in [1].
726726
Criterion satisfied when lower_line_length < line length difference
@@ -751,7 +751,7 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
751751
for each condition. Only provided if return_components is True.
752752
753753
alpha : scalar, optional
754-
Scaling factor applied to the ghi_clear to obtain the
754+
Scaling factor applied to the ``ghi_clear`` to obtain the
755755
detected clear_samples. Only provided if return_components is
756756
True.
757757
@@ -804,10 +804,10 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
804804
else:
805805
meas = measured
806806

807-
if not isinstance(clearsky, pd.Series):
808-
clear = pd.Series(clearsky, index=times)
807+
if not isinstance(ghi_clear, pd.Series):
808+
clear = pd.Series(ghi_clear, index=times)
809809
else:
810-
clear = clearsky
810+
clear = ghi_clear
811811

812812
sample_interval, samples_per_window = \
813813
tools._get_sample_intervals(times, window_length)
@@ -816,7 +816,7 @@ def detect_clearsky(measured, clearsky, times=None, infer_limits=False,
816816
if infer_limits:
817817
window_length, mean_diff, max_diff, lower_line_length, \
818818
upper_line_length, var_diff, slope_dev = \
819-
_clearsky_get_threshold(sample_interval)
819+
_clearsky_get_threshold(sample_interval)
820820

821821
# recalculate samples_per_window using returned window_length
822822
_, samples_per_window = \

0 commit comments

Comments
 (0)