Skip to content

irradiance.disc has unbounded clearness index calculation #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cwhanse opened this issue Aug 21, 2018 · 0 comments · Fixed by #400
Closed

irradiance.disc has unbounded clearness index calculation #540

cwhanse opened this issue Aug 21, 2018 · 0 comments · Fixed by #400
Labels
Milestone

Comments

@cwhanse
Copy link
Member

cwhanse commented Aug 21, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants