Skip to content

Commit 74e1fd1

Browse files
cwhansekandersolar
andauthored
Improve docstring for get_ground_diffuse (#1953)
* improve docstring for get_ground_diffuse * fix formatting. Reduce description text. Whatsnew * try to get the sphinx reference * sphinx reference * use doi * use math * use math * r * Update pvlib/irradiance.py Co-authored-by: Kevin Anderson <[email protected]> --------- Co-authored-by: Kevin Anderson <[email protected]>
1 parent 1e4d6f5 commit 74e1fd1

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

docs/sphinx/source/whatsnew/v0.10.4.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ Testing
3434

3535
Documentation
3636
~~~~~~~~~~~~~
37+
* Improved references and description for :py:func:`~pvlib.irradiance.get_ground_diffuse`. (:pull:`1953`)
3738
* Fixed broken URLs in various places. (:pull:`1957`, :pull:`1960`)
3839
* Clarified documentation for :py:func:`~pvlib.irradiance.get_ground_diffuse`. (:pull:`1883`)
3940

41+
4042
Requirements
4143
~~~~~~~~~~~~
4244

pvlib/irradiance.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -551,15 +551,16 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
551551

552552

553553
def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
554-
'''
555-
Estimate diffuse irradiance from ground reflections given
556-
irradiance, albedo, and surface tilt. The ground is assumed to
557-
be horizontal, flat and Lambertian, and the reflected irradiance
558-
is isotropic.
554+
r'''
555+
Estimate diffuse irradiance on a tilted surface from ground reflections.
556+
557+
Ground diffuse irradiance is calculated as
558+
559+
.. math::
560+
561+
G_{ground} = GHI \times \rho \times \frac{1 - \cos\beta}{2}
559562
560-
Function to determine the portion of irradiance on a tilted surface
561-
due to ground reflections. Any of the inputs may be DataFrames or
562-
scalars.
563+
where :math:`\rho` is ``albedo`` and :math:`\beta` is ``surface_tilt``.
563564
564565
Parameters
565566
----------
@@ -569,13 +570,13 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
569570
(e.g. surface facing up = 0, surface facing horizon = 90).
570571
571572
ghi : numeric
572-
Global horizontal irradiance. [W/m^2]
573+
Global horizontal irradiance. :math:`W/m^2`
573574
574575
albedo : numeric, default 0.25
575576
Ground reflectance, typically 0.1-0.4 for surfaces on Earth
576577
(land), may increase over snow, ice, etc. May also be known as
577578
the reflection coefficient. Must be >=0 and <=1. Will be
578-
overridden if surface_type is supplied.
579+
overridden if ``surface_type`` is supplied.
579580
580581
surface_type : string, optional
581582
If supplied, overrides ``albedo``. ``surface_type`` can be one of
@@ -586,22 +587,22 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
586587
Returns
587588
-------
588589
grounddiffuse : numeric
589-
Ground reflected irradiance. [W/m^2]
590+
Ground reflected irradiance. :math:`W/m^2`
590591
592+
Notes
593+
-----
594+
Table of albedo values by ``surface_type`` are from [2]_, [3]_, [4]_;
595+
see :py:data:`~pvlib.irradiance.SURFACE_ALBEDOS`.
591596
592597
References
593598
----------
594599
.. [1] Loutzenhiser P.G. et. al. "Empirical validation of models to compute
595600
solar irradiance on inclined surfaces for building energy simulation"
596601
2007, Solar Energy vol. 81. pp. 254-267.
597-
598-
The calculation is the last term of equations 3, 4, 7, 8, 10, 11, and 12.
599-
600-
.. [2] albedos from:
601-
http://files.pvsyst.com/help/albedo.htm
602-
and
603-
http://en.wikipedia.org/wiki/Albedo
604-
and
602+
.. [2] https://www.pvsyst.com/help/albedo.htm Accessed January, 2024.
603+
.. [3] http://en.wikipedia.org/wiki/Albedo Accessed January, 2024.
604+
.. [4] Payne, R. E. "Albedo of the Sea Surface". J. Atmos. Sci., 29,
605+
pp. 959–970, 1972.
605606
:doi:`10.1175/1520-0469(1972)029<0959:AOTSS>2.0.CO;2`
606607
'''
607608

0 commit comments

Comments
 (0)