Skip to content
Open
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
25 changes: 24 additions & 1 deletion pvlib/clearsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,
report on clear sky models found the Ineichen/Perez model to have
excellent performance with a minimal input data set [3]_.

Default values for monthly Linke turbidity provided by SoDa [4]_, [5]_.
Default monthly Linke turbidity values are available via
:py:func:`pvlib.clearsky.lookup_linke_turbidity`, which uses data
provided by SoDa [4]_, [5]_.

Parameters
-----------
Expand Down Expand Up @@ -84,6 +86,22 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity,

.. [5] J. Remund, et. al., "Worldwide Linke Turbidity Information", Proc.
ISES Solar World Congress, June 2003. Goteborg, Sweden.

Examples
--------
>>> from pvlib.clearsky import lookup_linke_turbidity, ineichen
>>> from pvlib.location import Location
>>> import pandas as pd
>>>
>>> times = pd.date_range('2024-06-01', freq='1H', periods=24, tz='UTC')
>>> loc = Location(35, -110)
>>>
>>> tl = lookup_linke_turbidity(times, loc.latitude, loc.longitude)
>>> cs = ineichen(
... times, loc.latitude, loc.longitude,
... linke_turbidity=tl
... )

''' # noqa: E501

# ghi is calculated using either the equations in [1] by setting
Expand Down Expand Up @@ -150,6 +168,10 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None,
Look up the Linke Turibidity from the ``LinkeTurbidities.h5``
data file supplied with pvlib.

The Linke turbidity climatology used by this function is sourced from
SoDa (Solar Radiation Data) and corresponds to the references cited in
:py:func:`pvlib.clearsky.ineichen`.
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense to include and cite those references in this docstring, instead of referencing the ineichen docstring?


Parameters
----------
time : pandas.DatetimeIndex
Expand All @@ -175,6 +197,7 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None,
The returned value for each time is either the monthly value or an
interpolated value to smooth the transition between months.
Interpolation is done on the day of year as determined by UTC.

"""

# The .h5 file 'LinkeTurbidities.h5' contains a single 2160 x 4320 x 12
Expand Down