Skip to content

irradiance.disc has unbounded clearness index calculation #540

Closed

Description

@cwhanse

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

Activity

  1. added this to the 0.6.0 milestone on Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions