8000 Improve `schlick_diffuse` docstring (#1812) · Mohitajm/pvlib-python@51910d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51910d1

Browse files
kandersolarcwhanseadriesse
authored
Improve schlick_diffuse docstring (pvlib#1812)
* docstring improvements * whatsnew * correct docstring section order * Apply suggestions from code review Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> * Update pvlib/iam.py Co-authored-by: Anton Driesse <anton.driesse@pvperformancelabs.com> --------- Co-authored-by: Cliff Hansen <cwhanse@sandia.gov> Co-authored-by: Anton Driesse <anton.driesse@pvperformancelabs.com>
1 parent e762e8a commit 51910d1

File tree

2 files changed

+50
-12
lines changed

2 files changed

+50
-12
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Testing
3131

3232
Documentation
3333
~~~~~~~~~~~~~
34+
* Added docstring detail for :py:func:`pvlib.iam.schlick_diffuse`.
35+
(:issue:`1811`, :pull:`1812`)
3436
* Removed Stickler-CI integration as the service has ceased June 2023.
3537
(:issue:`1722`, :pull:`1723`)
3638

pvlib/iam.py

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ def schlick(aoi):
800800
801801
In PV contexts, the Schlick approximation has been used as an analytically
802802
integrable alternative to the Fresnel equations for estimating IAM
803-
for diffuse irradiance [2]_.
803+
for diffuse irradiance [2]_ (see :py:func:`schlick_diffuse`).
804804
805805
Parameters
806806
----------
@@ -813,6 +813,10 @@ def schlick(aoi):
813813
iam : numeric
814814
The incident angle modifier.
815815
816+
See Also
817+
--------
818+
pvlib.iam.schlick_diffuse
819+
816820
References
817821
----------
818822
.. [1] Schlick, C. An inexpensive BRDF model for physically-based
@@ -822,10 +826,6 @@ def schlick(aoi):
822826
for Diffuse radiation on Inclined photovoltaic Surfaces (FEDIS)",
823827
Renewable and Sustainable Energy Reviews, vol. 161, 112362. June 2022.
824828
:doi:`10.1016/j.rser.2022.112362`
825-
826-
See Also
827-
--------
828-
pvlib.iam.schlick_diffuse
829829
"""
830830
iam = 1 - (1 - cosd(aoi)) ** 5
831831
iam = np.where(np.abs(aoi) >= 90.0, 0.0, iam)
@@ -845,9 +845,20 @@ def schlick_diffuse(surface_tilt):
845845
ground-reflected irradiance on a tilted surface using the Schlick
846846
incident angle model.
847847
848-
The diffuse iam values are calculated using an analytical integration
849-
of the Schlick equation [1]_ over the portion of an isotropic sky and
850-
isotropic foreground that is visible from the tilted surface [2]_.
848+
The Schlick equation (or "Schlick's approximation") [1]_ is an
849+
approximation to the Fresnel reflection factor which can be recast as
850+
a simple photovoltaic IAM model like so:
851+
852+
.. math::
853+
854+
IAM = 1 - (1 - \cos(aoi))^5
855+
856+
Unlike the Fresnel reflection factor itself, Schlick's approximation can
857+
be integrated analytically to derive a closed-form equation for diffuse
858+
IAM factors for the portions of the sky and ground visible
859+
from a tilted surface if isotropic distributions are assumed.
860+
This function implements the integration of the
861+
Schlick approximation provided by Xie et al. [2]_.
851862
852863
Parameters
853864
----------
@@ -863,6 +874,35 @@ def schlick_diffuse(surface_tilt):
863874
iam_ground : numeric
864875
The incident angle modifier for ground-reflected diffuse.
865876
877+
See Also
878+
--------
879+
pvlib.iam.schlick
880+
881+
Notes
882+
-----
883+
The analytical integration of the Schlick approximation was derived
884+
as part of the FEDIS diffuse IAM model [2]_. Compared with the model
885+
implemented in this function, the FEDIS model includes an additional term
886+
to account for reflection off a pyranometer's glass dome. Because that
887+
reflection should already be accounted for in the instrument's calibration,
888+
the pvlib authors believe it is inappropriate to account for pyranometer
889+
reflection again in an IAM model. Thus, this function omits that term and
890+
implements only the integrated Schlick approximation.
891+
892+
Note also that the output of this function (which is an exact integration)
893+
can be compared with the output of :py:func:`marion_diffuse` which numerically
894+
integrates the Schlick approximation:
895+
896+
.. code::
897+
898+
>>> pvlib.iam.marion_diffuse('schlick', surface_tilt=20)
899+
{'sky': 0.9625000227247358,
900+
'horizon': 0.7688174948510073,
901+
'ground': 0.6267861879241405}
902+
903+
>>> pvlib.iam.schlick_diffuse(surface_tilt=20)
904+
(0.9624993421569652, 0.6269387554469255)
905+
866906
References
867907
----------
868908
.. [1] Schlick, C. An inexpensive BRDF model for physically-based
@@ -872,10 +912,6 @@ def schlick_diffuse(surface_tilt):
872912
for Diffuse radiation on Inclined photovoltaic Surfaces (FEDIS)",
873913
Renewable and Sustainable Energy Reviews, vol. 161, 112362. June 2022.
874914
:doi:`10.1016/j.rser.2022.112362`
875-
876-
See Also
877-
--------
878-
pvlib.iam.schlick
879915
"""
880916
# these calculations are as in [2]_, but with the refractive index
881917
# weighting coefficient w set to 1.0 (so it is omitted)

0 commit comments

Comments
 (0)
0