-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Raise helpful exceptions for irradiance.gti_dirint #2347
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
Changes from 6 commits
8e0c7f0
1f5562e
ab7c411
10dcb6d
613f539
504122b
675a422
5ac3b35
afbe880
93781e2
f3db9b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2368,6 +2368,9 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, | |
irradiance, Solar Energy 122, 1037-1046. | ||
:doi:`10.1016/j.solener.2015.10.024` | ||
""" | ||
# check input data and raise Exceptions where data will cause the | ||
# algorithm to fail | ||
_gti_dirint_check_input(aoi) | ||
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. I wouldn't bother with a function for this. 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. I wouldn't either if this was the only condition to check. But I'm certain there are other data requirements which we haven't deduced yet and thought it helpful to put the function in place to collect checks. 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. There's probably some pythonic aphorism for these situations. |
||
|
||
aoi_lt_90 = aoi < 90 | ||
|
||
|
@@ -2399,6 +2402,17 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, | |
return output | ||
|
||
|
||
def _gti_dirint_check_input(aoi): | ||
r""" | ||
Helper for gti_dirint | ||
|
||
Raises Exceptions from input data that cause the algorithm to fail. | ||
""" | ||
if (aoi >= 90).all(): | ||
kandersolar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
raise ValueError("AOI >= 90 for all input data to gti_dirint. " | ||
cwhanse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
"gti_dirint requires some data with AOI < 90.") | ||
|
||
|
||
def _gti_dirint_lt_90(poa_global, aoi, aoi_lt_90, solar_zenith, solar_azimuth, | ||
times, surface_tilt, surface_azimuth, pressure=101325., | ||
use_delta_kt_prime=True, temp_dew=None, albedo=.25, | ||
|
Uh oh!
There was an error while loading. Please reload this page.