-
Notifications
You must be signed in to change notification settings - Fork 1.1k
limit cos(aoi) in diffuse sky functions #535
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9a74404
limit cos(aoi) in diffuse sky functions
wholmgren c8530a2
no limit on cos_solar_zenith in hb calculation. change proj limit to -1
wholmgren c0943a8
reimplement without projection_minimum kwarg
wholmgren 205cc16
fix np.minimum vs. np.maximum
wholmgren 1122055
update tutorial
wholmgren 0e3fb1a
add sky diffuse test for zenith close to 90
wholmgren e23d9d3
Merge remote-tracking branch 'pvlib/master' into aoidiff
wholmgren eead186
fix botched whatsnew merge [skip ci]
wholmgren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,7 +256,7 @@ def poa_horizontal_ratio(surface_tilt, surface_azimuth, | |
|
||
cos_solar_zenith = tools.cosd(solar_zenith) | ||
|
||
# ratio of titled and horizontal beam irradiance | ||
# ratio of tilted and horizontal beam irradiance | ||
ratio = cos_poa_zen / cos_solar_zenith | ||
|
||
try: | ||
|
@@ -746,6 +746,7 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, | |
# zenith angle with respect to panel normal. | ||
cos_tt = aoi_projection(surface_tilt, surface_azimuth, | ||
solar_zenith, solar_azimuth) | ||
cos_tt = np.minimum(cos_tt, 0) # GH 526 | ||
|
||
F = 1 - ((dhi / ghi) ** 2) | ||
try: | ||
|
@@ -836,8 +837,9 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, | |
if projection_ratio is None: | ||
cos_tt = aoi_projection(surface_tilt, surface_azimuth, | ||
solar_zenith, solar_azimuth) | ||
cos_tt = np.minimum(cos_tt, 0) # GH 526 | ||
cos_solar_zenith = tools.cosd(solar_zenith) | ||
Rb = cos_tt / cos_solar_zenith | ||
Rb = cos_tt / np.maximum(cos_solar_zenith, 0.01745) # GH 432 | ||
else: | ||
Rb = projection_ratio | ||
|
||
|
@@ -932,11 +934,13 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, | |
|
||
cos_tt = aoi_projection(surface_tilt, surface_azimuth, | ||
solar_zenith, solar_azimuth) | ||
cos_tt = np.minimum(cos_tt, 0) # GH 526 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
# do not apply cos(zen) limit here (needed for HB below) | ||
cos_solar_zenith = tools.cosd(solar_zenith) | ||
|
||
# ratio of titled and horizontal beam irradiance | ||
Rb = cos_tt / cos_solar_zenith | ||
Rb = cos_tt / np.maximum(cos_solar_zenith, 0.01745) # GH 432 | ||
|
||
# Anisotropy Index | ||
AI = dni / dni_extra | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
np.maximum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hay and Davies:
test_haydavies
fails because of this errornp.minimum
. Otherwise I believe it should pass.