From ab96973b7b88b43cf0216daea541ab8b2d756beb Mon Sep 17 00:00:00 2001 From: kumaradityaapril Date: Wed, 4 Feb 2026 00:06:26 +0530 Subject: [PATCH 1/2] DOC: clarify Linke turbidity source and usage for Ineichen clearsky model --- pvlib/clearsky.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 8cc867e020..514755305e 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -28,7 +28,10 @@ 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]_. Users must supply Linke turbidity values + explicitly unless providing their own turbidity data. Parameters ----------- @@ -150,6 +153,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`. + Parameters ---------- time : pandas.DatetimeIndex @@ -175,6 +182,20 @@ 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. + + 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) + """ # The .h5 file 'LinkeTurbidities.h5' contains a single 2160 x 4320 x 12 From b395ef2302b8857e8a9e5c3b736c5684edac30a5 Mon Sep 17 00:00:00 2001 From: kumaradityaapril Date: Wed, 4 Feb 2026 23:51:21 +0530 Subject: [PATCH 2/2] DOC: move Ineichen example and clarify Linke turbidity references --- pvlib/clearsky.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 514755305e..be0056b165 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -30,8 +30,7 @@ def ineichen(apparent_zenith, airmass_absolute, linke_turbidity, Default monthly Linke turbidity values are available via :py:func:`pvlib.clearsky.lookup_linke_turbidity`, which uses data - provided by SoDa [4]_, [5]_. Users must supply Linke turbidity values - explicitly unless providing their own turbidity data. + provided by SoDa [4]_, [5]_. Parameters ----------- @@ -87,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 @@ -183,19 +198,6 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None, interpolated value to smooth the transition between months. Interpolation is done on the day of year as determined by UTC. - 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) - """ # The .h5 file 'LinkeTurbidities.h5' contains a single 2160 x 4320 x 12