Skip to content

Commit 3ba597e

Browse files
committed
DOC: add example for Kasten pyrheliometric formula
* closes pvlib#302 * add references to Kasten 96 and Molineaux * discuss using Kasten and calculating broadband AOD usinge Angstrom turbidity model Signed-off-by: Mark Mikofski <[email protected]>
1 parent 05b0674 commit 3ba597e

File tree

1 file changed

+68
-7
lines changed

1 file changed

+68
-7
lines changed

docs/sphinx/source/clearsky.rst

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ time series of clear sky data for a location. The :ref:`ineichen` and
2626
input data. The :ref:`detect_clearsky` subsection demonstrates the use
2727
of the clear sky detection algorithm.
2828

29-
The :py:func:`~pvlib.atmosphere.bird_hulstrom80_aod_bb`, and
30-
:py:func:`~pvlib.atmosphere.kasten96_lt` functions are useful for
31-
calculating inputs to the clear sky functions.
32-
3329
We'll need these imports for the examples below.
3430

3531
.. ipython::
@@ -42,7 +38,7 @@ We'll need these imports for the examples below.
4238

4339
In [1]: import pvlib
4440

45-
In [1]: from pvlib import clearsky, atmosphere
41+
In [1]: from pvlib import clearsky, atmosphere, tmy, solarposition
4642

4743
In [1]: from pvlib.location import Location
4844

@@ -118,6 +114,57 @@ The Ineichen and Perez clear sky model parameterizes irradiance in terms
118114
of the Linke turbidity [Ine02]_. pvlib-python implements this model in
119115
the :py:func:`pvlib.clearsky.ineichen` function.
120116

117+
118+
The :py:func:`~pvlib.atmosphere.kasten96_lt` function can be used to calculate
119+
Linke turbidity [Kas96]_ as input to the clear sky Ineichen and Perez function.
120+
The Kasten formulation requires precipitable water and broadband AOD which can
121+
be approximated at 700-nm [Mol98]_ or from the function,
122+
:py:func:`~pvlib.atmosphere.bird_hulstrom80_aod_bb` which uses a combination of
123+
AOD measured at two wavelengths.
124+
125+
.. ipython::
126+
127+
In [1]: MBARS = 100 # conversion factor from mbars to Pa
128+
129+
In [1]: URL = 'http://rredc.nrel.gov/solar/old_data/nsrdb/1991-2005/data/tmy3/722040TYA.CSV'
130+
131+
In [1]: melbourne = tmy.readtmy3(URL)
132+
133+
In [1]: dt = pd.DatetimeIndex(start='2000-01-01 01:00:00', end='2000-12-31', freq='H')
134+
135+
In [1]: melbourne[0].index = dt
136+
137+
In [1]: melbourne_tl = clearsky.lookup_linke_turbidity(time=melbourne[0].index,
138+
...: latitude=melbourne[1]['latitude'], longitude=melbourne[1]['longitude'])
139+
140+
In [1]: melbourne_solpos = solarposition.get_solarposition(time=melbourne[0].index,
141+
...: latitude=melbourne[1]['latitude'], longitude=melbourne[1]['longitude'],
142+
...: altitude=melbourne[1]['altitude'], pressure=melbourne[0]['Pressure']*MBARS,
143+
...: temperature=melbourne[0]['DryBulb'])
144+
145+
In [1]: am_rel = atmosphere.relativeairmass(melbourne_solpos.apparent_zenith)
146+
147+
In [1]: am_abs = atmosphere.absoluteairmass(am_rel, melbourne[0]['Pressure']*MBARS)
148+
149+
In [1]: melbourne_am = pd.DataFrame({'airmass_relative': am_rel, 'airmass_absolute': am_abs},
150+
...: index=melbourne[0].index)
151+
152+
In [1]: melbourne_tl_molineaux = atmosphere.kasten96_lt(
153+
...: melbourne_am.airmass_absolute, melbourne[0]['Pwat'], melbourne[0]['AOD'])
154+
155+
In [1]: tl = pd.concat([melbourne_tl, melbourne_tl_molineaux], axis=1)
156+
157+
In [1]: tl.rename(columns={0:'TL', 1:'Kasten'}).resample('W').mean().plot();
158+
159+
In [1]: plt.grid()
160+
161+
In [1]: plt.title('\n'.join(['Comparison of Historic Linke Turbidity Factors vs.',
162+
...: 'Kasten Pyrheliometric Formula at Melbourne, FL (722040TYA)']));
163+
164+
@savefig kasten-tl.png width=10in
165+
In [1]: plt.ylabel('Linke Turbidity Factor, TL');
166+
167+
121168
Turbidity data
122169
^^^^^^^^^^^^^^
123170

@@ -327,8 +374,14 @@ from the `ECMWF <https://software.ecmwf.int/wiki/display/WEBAPI/Access+ECMWF+Pub
327374
and `SoDa <http://www.soda-pro.com/web-services/radiation/cams-mcclear>`_.
328375

329376
Aerosol optical depth is a function of wavelength, and the Simplified
330-
Solis model requires AOD at 700 nm. Models exist to convert AOD between
331-
different wavelengths, as well as convert Linke turbidity to AOD and PW
377+
Solis model requires AOD at 700 nm. The function,
378+
:py:func:`~pvlib.atmosphere.angstrom_aod_at_lambda`, is useful for converting
379+
AOD between different wavelengths using the Angstrom turbidity model and given
380+
the Angstrom exponent, :math:`\alpha`, which can be calculated from AOD at two
381+
wavelengths with the :py:func:`~pvlib.atmosphere.angstrom_alpha` function. The
382+
function, :py:func:`~pvlib.atmosphere.bird_hulstrom80_aod_bb`, can be used to
383+
approximate broadband AOD based on the Bird and Hulstrom model, but the
384+
recommendation by Molineaux is to use AOD at 700-nm for broadband.
332385
[Ine08con]_, [Ine16]_.
333386

334387

@@ -617,3 +670,11 @@ References
617670
.. [Ren16] Reno, M.J. and C.W. Hansen, "Identification of periods of clear
618671
sky irradiance in time series of GHI measurements" Renewable Energy,
619672
v90, p. 520-531, 2016.
673+
674+
.. [Mol98] B. Molineaux, P. Ineichen, and N. O’Neill, “Equivalence of
675+
pyrheliometric and monochromatic aerosol optical depths at a single key
676+
wavelength.,” Appl. Opt., vol. 37, no. 30, pp. 7008–18, Oct. 1998.
677+
678+
.. [Kas96] F. Kasten, “The linke turbidity factor based on improved values
679+
of the integral Rayleigh optical thickness,” Sol. Energy, vol. 56, no. 3,
680+
pp. 239–244, Mar. 1996.

0 commit comments

Comments
 (0)