Closed
Description
In pvlib.irradiance.disc
the clearness index kt
is calculated as kt = ghi / I0h
. Negative values of kt
are removed but large values are not. In rare circumstances, ghi
(e.g., from a clear sky model) greatly exceeds I0h
yielding kt
values upwards of 80. These values lead to a numpy overflow warning at
delta_kn
= a + b + np.exp(c*am)`
because c
is very large.
To demonstrate:
import pvlib
from pandas import Timestamp
ts = Timestamp('2016-07-19 06:11:00-0600', tz='US/Mountain', freq='T')
pvlib.irradiance.disc(ghi=1.0, zenith=89.99, datetime_or_doy=ts)
Expected behavior
irradiance.disc
should use the new clearness_index
function which sets an upper bound on kt
Versions:
pvlib.__version__
: 0.5.1