Skip to content

Commit 603ede0

Browse files
cwhanseadriesseechedey-ls
authored
Clarify linke turbidity in docs for clearsky.ineichen (pvlib#2746)
* edit docstring to clarify linke turbidity * whatsnew * Update pvlib/clearsky.py Co-authored-by: Anton Driesse <anton.driesse@pvperformancelabs.com> * Update pvlib/clearsky.py Co-authored-by: Anton Driesse <anton.driesse@pvperformancelabs.com> * Update pvlib/clearsky.py Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> * add internal reference * blank line * move down a few lines --------- Co-authored-by: Anton Driesse <anton.driesse@pvperformancelabs.com> Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com>
1 parent 2f26406 commit 603ede0

3 files changed

Lines changed: 29 additions & 21 deletions

File tree

docs/sphinx/source/user_guide/modeling_topics/clearsky.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,11 @@ wavelengths [Bir80]_, and is implemented in
255255
@savefig kasten-tl.png width=10in
256256
In [1]: plt.tight_layout()
257257

258-
259258
Examples
260259
^^^^^^^^
261260

261+
.. _clearsky-examples:
262+
262263
A clear sky time series using only basic pvlib functions.
263264

264265
.. ipython::
@@ -281,7 +282,6 @@ A clear sky time series using only basic pvlib functions.
281282

282283
In [1]: dni_extra = pvlib.irradiance.get_extra_radiation(times)
283284

284-
# an input is a pandas Series, so solis is a DataFrame
285285
In [1]: ineichen = clearsky.ineichen(apparent_zenith, airmass, linke_turbidity, altitude, dni_extra)
286286

287287
In [1]: plt.figure();

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ Enhancements
2525

2626
Documentation
2727
~~~~~~~~~~~~~
28-
* Clarified that :py:func:`pvlib.soiling.hsu` has an implicit minimum
28+
* Clarifies that :py:func:`pvlib.soiling.hsu` has an implicit minimum
2929
soiling ratio of approximately 0.6563 due to the mathematical form
3030
of the model. (:issue:`2534`, :pull:`2743`)
31+
* Clarifies how Linke turbidity values can be provided to
32+
:py:func:`pvlib.clearsky.ineichen` via
33+
:py:func:`pvlib.clearsky.lookup_linke_turbidity` (:issue:`2598`, :pull:`2746`)
3134

3235

3336
Testing

pvlib/clearsky.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,46 @@
1919
def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,
2020
altitude=0, dni_extra=1364., perez_enhancement=False):
2121
'''
22-
Determine clear sky GHI, DNI, and DHI from Ineichen/Perez model.
22+
Determine clear-sky GHI, DNI, and DHI using the Ineichen/Perez model.
2323
24-
Implements the Ineichen and Perez clear sky model for global
25-
horizontal irradiance (GHI), direct normal irradiance (DNI), and
26-
calculates the clear-sky diffuse horizontal (DHI) component as the
27-
difference between GHI and DNI*cos(zenith) as presented in [1]_ [2]_. A
28-
report on clear sky models found the Ineichen/Perez model to have
24+
The Ineichen and Perez clear sky model [1]_ [2]_ estimates global
25+
horizontal irradiance (GHI) and direct normal irradiance (DNI). Diffuse
26+
horizontal irradiance (DHI) is then computed as DHI = GHI - DNI*cos(zenith)
27+
Analysis of clear sky models found the Ineichen/Perez model to have
2928
excellent performance with a minimal input data set [3]_.
3029
31-
Default values for monthly Linke turbidity provided by SoDa [4]_, [5]_.
30+
The Ineichen/Perez model requires Linke turbidity as input. Monthly
31+
averages of gridded Linke turbidity (historical data from SoDa [4]_, [5]_)
32+
are available using :py:func:`~pvlib.clearsky.lookup_linke_turbidity`.
3233
3334
Parameters
3435
-----------
3536
apparent_zenith : numeric
36-
Refraction corrected solar zenith angle in degrees.
37+
Refraction-corrected solar zenith angle. [°]
3738
3839
airmass_absolute : numeric
39-
Pressure corrected airmass.
40+
Pressure-corrected airmass. [unitless]
4041
4142
linke_turbidity : numeric
42-
Linke Turbidity.
43+
Linke turbidity. [unitless]
4344
4445
altitude : numeric, default 0
45-
Altitude above sea level in meters.
46+
Altitude above sea level. [m]
4647
47-
dni_extra : numeric, default 1364
48-
Extraterrestrial irradiance. The units of ``dni_extra``
49-
determine the units of the output.
48+
dni_extra : numeric, default 1364 Wm⁻²
49+
Extraterrestrial irradiance.
5050
5151
perez_enhancement : bool, default False
52-
Controls if the Perez enhancement factor should be applied.
53-
Setting to True may produce spurious results for times when
52+
If ``True``, the Perez enhancement factor is applied.
53+
The Perez enhancement factor may produce spurious results when
5454
the Sun is near the horizon and the airmass is high.
5555
See https://github.com/pvlib/pvlib-python/issues/435
5656
5757
Returns
5858
-------
5959
clearsky : DataFrame (if Series input) or OrderedDict of arrays
60-
DataFrame/OrderedDict contains the columns/keys
61-
``'dhi', 'dni', 'ghi'``.
60+
Contains the columns/keys ``'dhi', 'dni', 'ghi'``, with the same
61+
unit as the input parameter ``dni_extra``.
6262
6363
See also
6464
--------
@@ -84,6 +84,11 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,
8484
8585
.. [5] J. Remund, et. al., "Worldwide Linke Turbidity Information", Proc.
8686
ISES Solar World Congress, June 2003. Goteborg, Sweden.
87+
88+
Examples
89+
--------
90+
See :ref:`Clearsky modeling examples <clearsky-examples>`
91+
8792
''' # noqa: E501
8893

8994
# ghi is calculated using either the equations in [1] by setting

0 commit comments

Comments
 (0)