-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add orgill hollands decomposition #1730
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 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5cfe247
add orgill hollands decomposition
nicorie f4849ce
Fix Stickler
nicorie 7c5e72d
Update pvlib/irradiance.py
nicorie 097fe52
Update pvlib/irradiance.py
nicorie 92fea79
Update pvlib/irradiance.py
nicorie decabb4
Update pvlib/irradiance.py
nicorie b8b4b3a
Update irradiance.py
nicorie bacdc69
Merge branch 'main' into orgill_hollands
AdamRJensen f8b7dd9
Remove edits to boland
AdamRJensen b3d5cf0
Fix references and add output description
AdamRJensen 150c22e
Update decomposition.rst
nicorie ecfb0e8
Update test_irradiance.py
nicorie 1218564
Update test_irradiance.py
nicorie 0b42c44
Update v0.10.0.rst
nicorie 3e539f6
Merge branch 'main' into orgill_hollands
AdamRJensen 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2193,6 +2193,8 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): | |
-------- | ||
dirint | ||
disc | ||
orgill_hollands | ||
bolland | ||
""" | ||
|
||
dni_extra = get_extra_radiation(datetime_or_doy) | ||
|
@@ -2231,6 +2233,83 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): | |
return data | ||
|
||
|
||
def orgill_hollands(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, | ||
max_zenith=87): | ||
"""Estimate DNI and DHI from GHI using the Orgill and Hollands [1] model. | ||
|
||
The Orgill and Hollands model [1] estimates the diffuse fraction DF from | ||
nicorie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
global horizontal irradiance through an empirical relationship between | ||
hourly DF observations (in Toronto, Canada) and the ratio of GHI to | ||
extraterrestrial irradiance, Kt. | ||
|
||
Parameters | ||
---------- | ||
ghi: numeric | ||
Global horizontal irradiance in W/m^2. | ||
zenith: numeric | ||
True (not refraction-corrected) zenith angles in decimal degrees. | ||
datetime_or_doy : int, float, array, pd.DatetimeIndex | ||
Day of year or array of days of year e.g. | ||
pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. | ||
min_cos_zenith : numeric, default 0.065 | ||
Minimum value of cos(zenith) to allow when calculating global | ||
clearness index `kt`. Equivalent to zenith = 86.273 degrees. | ||
max_zenith : numeric, default 87 | ||
Maximum value of zenith to allow in DNI calculation. DNI will be | ||
set to 0 for times with zenith values greater than `max_zenith`. | ||
|
||
Returns | ||
------- | ||
None. | ||
|
||
References | ||
---------- | ||
[1] Orgill, J.F., Hollands, K.G.T., Correlation equation for hourly diffuse | ||
radiation on a horizontal surface, Solar Energy 19(4), pp 357–359, 1977. | ||
Eqs. 3(a), 3(b) and 3(c) | ||
nicorie marked this conversation as resolved.
Show resolved
Hide resolved
nicorie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
See Also | ||
-------- | ||
dirint | ||
disc | ||
erbs | ||
bolland | ||
nicorie marked this conversation as resolved.
Show resolved
Hide resolved
nicorie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
""" | ||
dni_extra = get_extra_radiation(datetime_or_doy) | ||
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 we want to add an argument |
||
|
||
kt = clearness_index(ghi, zenith, dni_extra, min_cos_zenith=min_cos_zenith, | ||
max_clearness_index=1) | ||
|
||
# For Kt < 0.35, set the diffuse fraction | ||
df = 1 - 0.249*kt | ||
|
||
# For Kt >= 0.35 and Kt <= 0.75, set the diffuse fraction | ||
df = np.where((kt >= 0.35) & (kt <= 0.75), | ||
1.557 - 1.84*kt, df) | ||
|
||
# For Kt > 0.75, set the diffuse fraction | ||
df = np.where(kt > 0.75, 0.177, df) | ||
|
||
dhi = df * ghi | ||
|
||
dni = (ghi - dhi) / tools.cosd(zenith) | ||
bad_values = (zenith > max_zenith) | (ghi < 0) | (dni < 0) | ||
dni = np.where(bad_values, 0, dni) | ||
# ensure that closure relationship remains valid | ||
dhi = np.where(bad_values, ghi, dhi) | ||
|
||
data = OrderedDict() | ||
data['dni'] = dni | ||
data['dhi'] = dhi | ||
data['kt'] = kt | ||
|
||
if isinstance(datetime_or_doy, pd.DatetimeIndex): | ||
data = pd.DataFrame(data, index=datetime_or_doy) | ||
|
||
return data | ||
|
||
|
||
def campbell_norman(zenith, transmittance, pressure=101325.0, | ||
dni_extra=1367.0): | ||
''' | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.