Skip to content

Correct condition 5 in clearsky.detect_clearsky #506

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 Jul 18, 2018 · 5 comments
Closed

Correct condition 5 in clearsky.detect_clearsky #506

cwhanse opened this issue Jul 18, 2018 · 5 comments
Labels
Milestone

Comments

@cwhanse
Copy link
Member

cwhanse commented Jul 18, 2018

Describe the bug
Condition 5 in clearsky.detect_clearsky does not agree with Eq. 12 - 14 of the reference. See #505

Expected behavior
clearsky.detect_clearsky currently calculates condition 5 as the difference in maximum absolute slopes, rather than the maximum of the absolute differences in slopes.

Versions:

  • pvlib.__version__: 0.5
@cwhanse cwhanse added the bug label Jul 18, 2018
@wholmgren
Copy link
Member

If I understand correctly, the pvlib code is essentially:

X  = max(abs(meas_slope)) - max(abs(clear_slope))
c5 = X < slope_dev

but Reno and Hansen describe:

X  = max(abs(meas_slope - clear_slope))
   = max(abs(line_diff_slope))
c5 = X < slope_dev

It would be good to include an example/test where this changes the overall result.

@wholmgren wholmgren added this to the 0.6.0 milestone Jul 18, 2018
@cwhanse
Copy link
Member Author

cwhanse commented Jul 18, 2018

@wholmgren you understand correctly.

Do we need to test before/after when fixing a bug though?

@adriesse
Copy link
Member

Perhaps not in general, but in this case it sound like the published results may have been based on code with a bug, so technically you should perhaps run the corrected code, check the results and publish an erratum.

@wholmgren
Copy link
Member

@cwhanse my feeling is that the detect_clearsky_data.csv test data should include values that produce a different test result when the code is changed.

@cwhanse
Copy link
Member Author

cwhanse commented Jul 19, 2018

Of course, I agree that we should correct the test along with the code fix. I can publish a comparison on pvpmc.sandia.gov, or post the results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants