-
Notifications
You must be signed in to change notification settings - Fork 1.1k
_delta_kt_prime_dirint() Method Returns Values That Are Half of What they Should be #637
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
Comments
@chriswmackey verified. Calculating Kt' is handled differently in PVLib Matlab |
@chriswmackey thanks very much for bringing this to our attention! |
This bug affects the first and last values in a time series of DNI calculated by |
thanks @chriswmackey for the report and @cwhanse for the fix. |
Thank you @cwhanse for the fix! It's a great library that you have built here. |
Hello,
I believe that I have found a bug or at least a misalignment between a formula that was written in a publication and the result of a pvlib method.
The bug appears specifically on these lines of the _delta_kt_prime_dirint() method in irradiance.py:
https://github.com/pvlib/pvlib-python/blob/master/pvlib/irradiance.py#L1566-L1568
... and I realize that this formula references Perez's equation 2 as follows:

Here is the full publication where the image above came from from:
https://www.researchgate.net/publication/279868352_Dynamic_global-to-direct_irradiance_conversion_models
The bug seems to be the result of how pandas deals with the
add()
method and thefill_value
.To re-create the bug, I recommend running the following code:
At the moment, this returns a delta_kt_prime value that is equal to 0.01. However, this should clearly be equal to 0.02 according to Perez's equation 2.
Versions:
pvlib.__version__
: 0.6.0pandas.__version__
: 0.23.4The text was updated successfully, but these errors were encountered: