Skip to content

Add sea surface albedo #458

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 7 commits into from
May 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/sphinx/source/whatsnew/v0.6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ API Changes

Enhancements
~~~~~~~~~~~~

* Add sea surface albedo in irradiance.py (:issue:`458`)

Bug fixes
~~~~~~~~~
Expand All @@ -28,3 +28,4 @@ Testing
Contributors
~~~~~~~~~~~~
* Will Holmgren
* Yu Cao
13 changes: 8 additions & 5 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pvlib import solarposition
from pvlib import atmosphere


# see References section of grounddiffuse function
SURFACE_ALBEDOS = {'urban': 0.18,
'grass': 0.20,
'fresh grass': 0.26,
Expand All @@ -30,7 +30,8 @@
'aluminum': 0.85,
'copper': 0.74,
'fresh steel': 0.35,
'dirty steel': 0.08}
'dirty steel': 0.08,
'sea': 0.06}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add # see References section of grounddiffuse function to line 20.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works too



def extraradiation(datetime_or_doy, solar_constant=1366.1, method='spencer',
Expand Down Expand Up @@ -470,8 +471,8 @@ def grounddiffuse(surface_tilt, ghi, albedo=.25, surface_type=None):

surface_type: None or string, default None
If not None, overrides albedo. String can be one of ``'urban',
'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt',
'concrete', 'aluminum', 'copper', 'fresh steel', 'dirty steel'``.
'grass', 'fresh grass', 'snow', 'fresh snow', 'asphalt', 'concrete',
'aluminum', 'copper', 'fresh steel', 'dirty steel', 'sea'``.

Returns
-------
Expand All @@ -488,9 +489,11 @@ def grounddiffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
The calculation is the last term of equations 3, 4, 7, 8, 10, 11, and 12.

[2] albedos from:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move these comment lines to where SURFACE_ALBEDO is defined, unless that violates some python grammar rule (@wholmgren ??). You can drop the '[2]' Thanks again for these changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwhanse I think makes sense to continue to include this reference here (in the References section of the grounddiffuse docstring). This reference will be rendered into a readthedocs page, whereas a code comment will be hidden.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you both. I have added inline comments at line 20.

http://pvpmc.org/modeling-steps/incident-irradiance/plane-of-array-poa-irradiance/calculating-poa-irradiance/poa-ground-reflected/albedo/
http://files.pvsyst.com/help/albedo.htm
and
http://en.wikipedia.org/wiki/Albedo
and
https://doi.org/10.1175/1520-0469(1972)029<0959:AOTSS>2.0.CO;2
'''

if surface_type is not None:
Expand Down