Skip to content

Commit bf1c0d8

Browse files
committed
irradiance.py: ghi_from_poa() and clearsky_index()
also added units to ghi_clear in clearsky_index()
1 parent 4cfda4a commit bf1c0d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pvlib/irradiance.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth,
16031603
return ghi
16041604

16051605

1606-
def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0):
1606+
def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0):
16071607
"""
16081608
Calculate the clearsky index.
16091609
@@ -1615,8 +1615,8 @@ def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0):
16151615
ghi : numeric
16161616
Global horizontal irradiance. [Wm⁻²]
16171617
1618-
clearsky_ghi : numeric
1619-
Modeled clearsky GHI
1618+
ghi_clear : numeric
1619+
Modeled clearsky GHI. [Wm⁻²]
16201620
16211621
max_clearsky_index : numeric, default 2.0
16221622
Maximum value of the clearsky index. The default, 2.0, allows
@@ -1627,12 +1627,12 @@ def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0):
16271627
clearsky_index : numeric
16281628
Clearsky index
16291629
"""
1630-
clearsky_index = ghi / clearsky_ghi
1630+
clearsky_index = ghi / ghi_clear
16311631
# set +inf, -inf, and nans to zero
16321632
clearsky_index = np.where(~np.isfinite(clearsky_index), 0,
16331633
clearsky_index)
16341634
# but preserve nans in the input arrays
1635-
input_is_nan = ~np.isfinite(ghi) | ~np.isfinite(clearsky_ghi)
1635+
input_is_nan = ~np.isfinite(ghi) | ~np.isfinite(ghi_clear)
16361636
clearsky_index = np.where(input_is_nan, np.nan, clearsky_index)
16371637

16381638
clearsky_index = np.maximum(clearsky_index, 0)

0 commit comments

Comments
 (0)