From e5860fc6212adcc24d14cd3780b939546c891cab Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 19:59:17 +0100 Subject: [PATCH 01/25] Update irradiance.py add eqn variable definitions rearrange references changed beta into theta_T to avoid double definition --- surface tilt, and "daily average of the solar elevation in degrees" (pvlib.irradiance.diffuse_par_spitters) --- pvlib/irradiance.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 435c318562..c9a4d9f162 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -720,13 +720,10 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, solar_zenith=None, solar_azimuth=None, projection_ratio=None, return_components=False): r''' - Determine diffuse irradiance from the sky on a tilted surface using - Hay & Davies' 1980 model - - .. math:: - I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \cos\beta}{2}) ) + Determine diffuse irradiance from the sky on a tilted surface using the + Hay and Davies (1980) model [1]_. - Hay and Davies' 1980 model determines the diffuse irradiance from + The Hay and Davies model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this algorithm) on a tilted surface using the surface tilt angle, surface azimuth angle, diffuse horizontal irradiance, direct normal @@ -793,20 +790,31 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Notes ------ + The expression for the diffuse irradiance, :math:`I_d` in the Hay and + Davies model is as follows: + + .. math:: + I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \cos\beta}{2}) ). + + :math:`DHI` is the diffuse horizontal irradiance, + :math:`A` is the anisotropy index, which is the ratio of the direct normal + irradiance to the extraterrestrial irradiation, + :math:`R_b` is the cosine of the ratio of angle of incidence (AOI) to the + cosine of the zenith angle. + When supplying ``projection_ratio``, consider constraining its values when zenith angle approaches 90 degrees or angle of incidence projection is negative. See code for details. References ----------- - .. [1] Loutzenhiser P.G. et. al. "Empirical validation of models to - compute solar irradiance on inclined surfaces for building energy - simulation" 2007, Solar Energy vol. 81. pp. 254-267 - - .. [2] Hay, J.E., Davies, J.A., 1980. Calculations of the solar + .. [1] Hay, J.E., Davies, J.A., 1980. Calculations of the solar radiation incident on an inclined surface. In: Hay, J.E., Won, T.K. (Eds.), Proc. of First Canadian Solar Radiation Data Workshop, 59. Ministry of Supply and Services, Canada. + .. [2] Loutzenhiser P.G. et. al. "Empirical validation of models to + compute solar irradiance on inclined surfaces for building energy + simulation" 2007, Solar Energy vol. 81. pp. 254-267. ''' # if necessary, calculate ratio of titled and horizontal beam irradiance From 03d220da3095a21489cdca8c03bb805a89220a9b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:11:38 +0100 Subject: [PATCH 02/25] Update irradiance.py --- pvlib/irradiance.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index c9a4d9f162..640660efac 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -791,16 +791,17 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Notes ------ The expression for the diffuse irradiance, :math:`I_d` in the Hay and - Davies model is as follows: + Davies sky diffuse model is as follows: .. math:: - I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \cos\beta}{2}) ). + I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \cos\theta_T}{2}) ). :math:`DHI` is the diffuse horizontal irradiance, :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, :math:`R_b` is the cosine of the ratio of angle of incidence (AOI) to the - cosine of the zenith angle. + cosine of the zenith angle, and finally :math:`\theta_T` is the tilt angle + of the array. When supplying ``projection_ratio``, consider constraining its values when zenith angle approaches 90 degrees or angle of incidence From c64e3da88f9e201b51fd3ba870243b0ad87f9b68 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:12:43 +0100 Subject: [PATCH 03/25] Update irradiance.py Remove Loutzenhiser P.G. et. al. reference. I do not see it cited anywhere here in the docs for the haydavies model --- pvlib/irradiance.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 640660efac..f251161c4b 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -813,9 +813,6 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, radiation incident on an inclined surface. In: Hay, J.E., Won, T.K. (Eds.), Proc. of First Canadian Solar Radiation Data Workshop, 59. Ministry of Supply and Services, Canada. - .. [2] Loutzenhiser P.G. et. al. "Empirical validation of models to - compute solar irradiance on inclined surfaces for building energy - simulation" 2007, Solar Energy vol. 81. pp. 254-267. ''' # if necessary, calculate ratio of titled and horizontal beam irradiance From 97f94e878703d837dd8eaa2f85e3ad00fcd2ed56 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:17:09 +0100 Subject: [PATCH 04/25] Update irradiance.py add "projection ratio" to variable definition --- pvlib/irradiance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index f251161c4b..17f4d9d008 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -799,9 +799,9 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, :math:`DHI` is the diffuse horizontal irradiance, :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, - :math:`R_b` is the cosine of the ratio of angle of incidence (AOI) to the - cosine of the zenith angle, and finally :math:`\theta_T` is the tilt angle - of the array. + :math:`R_b` is the projection ratio, which is defined as the cosine of the + ratio of angle of incidence (AOI) to the cosine of the zenith angle, and + finally :math:`\theta_T` is the tilt angle of the array. When supplying ``projection_ratio``, consider constraining its values when zenith angle approaches 90 degrees or angle of incidence From 3baddf48aa35e41e0087f001a384975b58c9d685 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:24:44 +0100 Subject: [PATCH 05/25] Update irradiance.py separate A and R_b --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 17f4d9d008..b47afd45d6 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -794,7 +794,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Davies sky diffuse model is as follows: .. math:: - I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \cos\theta_T}{2}) ). + I_{d} = DHI ( A\cdot R_b + (1 - A) (\frac{1 + \cos\theta_T}{2}) ). :math:`DHI` is the diffuse horizontal irradiance, :math:`A` is the anisotropy index, which is the ratio of the direct normal From 87fc372f52316e42a787b49613322781ff63f42e Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:29:26 +0100 Subject: [PATCH 06/25] Update irradiance.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change all instances of W/m^2 into Wm⁻² --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index b47afd45d6..4ea9fe04d1 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -746,10 +746,10 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Diffuse horizontal irradiance in W/m^2. dni : numeric - Direct normal irradiance in W/m^2. + Direct normal irradiance in Wm⁻². dni_extra : numeric - Extraterrestrial normal irradiance in W/m^2. + Extraterrestrial normal irradiance in Wm⁻². solar_zenith : numeric, optional Solar apparent (refraction-corrected) zenith angles in decimal From f89f3f74972339f6e58e373701d7bb2fba74e51e Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:48:58 +0100 Subject: [PATCH 07/25] Update irradiance.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit W/m^2 to Wm⁻² --- pvlib/irradiance.py | 126 ++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 4ea9fe04d1..b1297915d1 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -463,15 +463,15 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): surface, from :func:`aoi`. dni : numeric - Direct normal irradiance (W/m^2), as measured from a TMY file or + Direct normal irradiance (Wm⁻²), as measured from a TMY file or calculated with a clearsky model. poa_sky_diffuse : numeric - Diffuse irradiance (W/m^2) in the plane of the modules, as + Diffuse irradiance (Wm⁻²) in the plane of the modules, as calculated by a diffuse irradiance translation function poa_ground_diffuse : numeric - Ground reflected irradiance (W/m^2) in the plane of the modules, + Ground reflected irradiance (Wm⁻²) in the plane of the modules, as calculated by an albedo model (eg. :func:`grounddiffuse`) Returns @@ -479,12 +479,12 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): irrads : OrderedDict or DataFrame Contains the following keys: - * ``poa_global`` : Total in-plane irradiance (W/m^2) - * ``poa_direct`` : Total in-plane beam irradiance (W/m^2) - * ``poa_diffuse`` : Total in-plane diffuse irradiance (W/m^2) - * ``poa_sky_diffuse`` : In-plane diffuse irradiance from sky (W/m^2) + * ``poa_global`` : Total in-plane irradiance (Wm⁻²) + * ``poa_direct`` : Total in-plane beam irradiance (Wm⁻²) + * ``poa_diffuse`` : Total in-plane diffuse irradiance (Wm⁻²) + * ``poa_sky_diffuse`` : In-plane diffuse irradiance from sky (Wm⁻²) * ``poa_ground_diffuse`` : In-plane diffuse irradiance from ground - (W/m^2) + (Wm⁻²) Notes ------ @@ -529,7 +529,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): (e.g. surface facing up = 0, surface facing horizon = 90). ghi : numeric - Global horizontal irradiance. :math:`W/m^2` + Global horizontal irradiance. :math:`Wm⁻²` albedo : numeric, default 0.25 Ground reflectance, typically 0.1-0.4 for surfaces on Earth @@ -546,7 +546,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): Returns ------- grounddiffuse : numeric - Ground reflected irradiance. :math:`W/m^2` + Ground reflected irradiance. :math:`Wm⁻²` Notes ----- @@ -602,7 +602,7 @@ def isotropic(surface_tilt, dhi): (e.g. surface facing up = 0, surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance in W/m^2. DHI must be >=0. + Diffuse horizontal irradiance in Wm⁻². DHI must be >=0. Returns ------- @@ -663,10 +663,10 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, east of north (e.g. North = 0, South=180 East = 90, West = 270). dhi : numeric - Diffuse horizontal irradiance in W/m^2. DHI must be >=0. + Diffuse horizontal irradiance in Wm⁻². DHI must be >=0. ghi : numeric - Global irradiance in W/m^2. DNI must be >=0. + Global irradiance in Wm⁻². DNI must be >=0. solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal @@ -743,7 +743,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, South=180, East=90, West=270). dhi : numeric - Diffuse horizontal irradiance in W/m^2. + Diffuse horizontal irradiance in Wm⁻². dni : numeric Direct normal irradiance in Wm⁻². @@ -884,16 +884,16 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, South=180 East = 90, West = 270). dhi : numeric - diffuse horizontal irradiance in W/m^2. + diffuse horizontal irradiance in Wm⁻². dni : numeric - direct normal irradiance in W/m^2. + direct normal irradiance in Wm⁻². ghi: numeric - Global irradiance in W/m^2. + Global irradiance in Wm⁻². dni_extra : numeric - Extraterrestrial normal irradiance in W/m^2. + Extraterrestrial normal irradiance in Wm⁻². solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -978,10 +978,10 @@ def king(surface_tilt, dhi, ghi, solar_zenith): surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance in W/m^2. + Diffuse horizontal irradiance in Wm⁻². ghi : numeric - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -1035,13 +1035,13 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, east of north (e.g. North = 0, South=180 East = 90, West = 270). dhi : numeric - Diffuse horizontal irradiance in W/m^2. DHI must be >=0. + Diffuse horizontal irradiance in Wm⁻². DHI must be >=0. dni : numeric - Direct normal irradiance in W/m^2. DNI must be >=0. + Direct normal irradiance in Wm⁻². DNI must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance in W/m^2. + Extraterrestrial normal irradiance in Wm⁻². solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1301,13 +1301,13 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, east of north (e.g. North = 0, South=180 East = 90, West = 270). dhi : numeric - Diffuse horizontal irradiance in W/m^2. dhi must be >=0. + Diffuse horizontal irradiance in Wm⁻². dhi must be >=0. dni : numeric - Direct normal irradiance in W/m^2. dni must be >=0. + Direct normal irradiance in Wm⁻². dni must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance in W/m^2. + Extraterrestrial normal irradiance in Wm⁻². solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1522,16 +1522,16 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, solar_azimuth : numeric Solar azimuth angle. [degree] poa_global : numeric - Plane-of-array global irradiance, aka global tilted irradiance. [W/m^2] + Plane-of-array global irradiance, aka global tilted irradiance. [Wm⁻²] dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [W/m^2] + Extraterrestrial direct normal irradiance. [Wm⁻²] airmass : numeric, optional Relative airmass (not adjusted for pressure). [unitless] albedo : numeric, default 0.25 Ground surface albedo. [unitless] xtol : numeric, default 0.01 Convergence criterion. The estimated GHI will be within xtol of the - true value. Must be positive. [W/m^2] + true value. Must be positive. [Wm⁻²] full_output : boolean, default False If full_output is False, only ghi is returned, otherwise the return value is (ghi, converged, niter). (see Returns section for details). @@ -1539,7 +1539,7 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, Returns ------- ghi : numeric - Estimated GHI. [W/m^2] + Estimated GHI. [Wm⁻²] converged : boolean, optional Present if full_output=True. Indicates which elements converged successfully. @@ -1598,7 +1598,7 @@ def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): Parameters ---------- ghi : numeric - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². clearsky_ghi : numeric Modeled clearsky GHI @@ -1641,7 +1641,7 @@ def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, Parameters ---------- ghi : numeric - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². solar_zenith : numeric True (not refraction-corrected) solar zenith angle in decimal @@ -1754,7 +1754,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Parameters ---------- ghi : numeric - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². solar_zenith : numeric True (not refraction-corrected) solar zenith angles in decimal @@ -1787,7 +1787,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Contains the following keys: * ``dni``: The modeled direct normal irradiance - in W/m^2 provided by the + in Wm⁻² provided by the Direct Insolation Simulation Code (DISC) model. * ``kt``: Ratio of global to extraterrestrial irradiance on a horizontal plane. @@ -1900,7 +1900,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, Parameters ---------- ghi : array-like - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². solar_zenith : array-like True (not refraction-corrected) solar_zenith angles in decimal @@ -1938,7 +1938,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, Returns ------- dni : array-like - The modeled direct normal irradiance in W/m^2 provided by the + The modeled direct normal irradiance in Wm⁻² provided by the DIRINT model. Notes @@ -2142,13 +2142,13 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Parameters ---------- ghi : array-like - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². ghi_clearsky : array-like - Global horizontal irradiance from clear sky model, in W/m^2. + Global horizontal irradiance from clear sky model, in Wm⁻². dni_clearsky : array-like - Direct normal irradiance from clear sky model, in W/m^2. + Direct normal irradiance from clear sky model, in Wm⁻². zenith : array-like True (not refraction-corrected) zenith angles in decimal @@ -2187,7 +2187,7 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Returns ------- dni : array-like - The modeled direct normal irradiance in W/m^2. + The modeled direct normal irradiance in Wm⁻². Notes ----- @@ -2234,12 +2234,12 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, Model performance is poor for AOI greater than approximately 80 degrees `and` plane of array irradiance greater than - approximately 200 W/m^2. + approximately 200 Wm⁻². Parameters ---------- poa_global : array-like - Plane of array global irradiance in W/m^2. + Plane of array global irradiance in Wm⁻². aoi : array-like Angle of incidence of solar rays with respect to the module @@ -2306,10 +2306,10 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, data : DataFrame Contains the following keys/columns: - * ``ghi``: the modeled global horizontal irradiance in W/m^2. - * ``dni``: the modeled direct normal irradiance in W/m^2. + * ``ghi``: the modeled global horizontal irradiance in Wm⁻². + * ``dni``: the modeled direct normal irradiance in Wm⁻². * ``dhi``: the modeled diffuse horizontal irradiance in - W/m^2. + Wm⁻². References ---------- @@ -2390,7 +2390,7 @@ def _gti_dirint_lt_90(poa_global, aoi, aoi_lt_90, solar_zenith, solar_azimuth, for iteration, coeff in enumerate(coeffs): # test if difference between modeled GTI and - # measured GTI (poa_global) is less than 1 W/m^2 + # measured GTI (poa_global) is less than 1 Wm⁻² # only test for aoi less than 90 deg best_diff_lte_1 = best_diff <= 1 best_diff_lte_1_lt_90 = best_diff_lte_1[aoi_lt_90] @@ -2571,7 +2571,7 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): Parameters ---------- ghi: numeric - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex @@ -2589,9 +2589,9 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in W/m^2. + * ``dni``: the modeled direct normal irradiance in Wm⁻². * ``dhi``: the modeled diffuse horizontal irradiance in - W/m^2. + Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance on a horizontal plane. @@ -2669,7 +2669,7 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array or pd.DatetimeIndex, optional @@ -2692,9 +2692,9 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in W/m^2. + * ``dni``: the modeled direct normal irradiance in Wm⁻². * ``dhi``: the modeled diffuse horizontal irradiance in - W/m^2. + Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance on a horizontal plane. @@ -2790,7 +2790,7 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance in W/m^2. + Global horizontal irradiance in Wm⁻². zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex @@ -2810,9 +2810,9 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in W/m^2. + * ``dni``: the modeled direct normal irradiance in Wm⁻². * ``dhi``: the modeled diffuse horizontal irradiance in - W/m^2. + Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance on a horizontal plane. @@ -2883,7 +2883,7 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, Parameters ---------- ghi: numeric - Global horizontal irradiance. [W/m^2] + Global horizontal irradiance. [Wm⁻²] solar_zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : numeric, pandas.DatetimeIndex @@ -2905,9 +2905,9 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in W/m^2. + * ``dni``: the modeled direct normal irradiance in Wm⁻². * ``dhi``: the modeled diffuse horizontal irradiance in - W/m^2. + Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance on a horizontal plane. @@ -2996,7 +2996,7 @@ def campbell_norman(zenith, transmittance, pressure=101325.0, ------- irradiance: DataFrame Modeled direct normal irradiance, direct horizontal irradiance, - and global horizontal irradiance in W/m^2 + and global horizontal irradiance in Wm⁻² References ---------- @@ -3053,7 +3053,7 @@ def _liujordan(zenith, transmittance, airmass, dni_extra=1367.0): ------- irradiance: DataFrame Modeled direct normal irradiance, direct horizontal irradiance, - and global horizontal irradiance in W/m^2 + and global horizontal irradiance in Wm⁻² References ---------- @@ -3727,7 +3727,7 @@ def louche(ghi, solar_zenith, datetime_or_doy, max_zenith=90): Parameters ---------- ghi : numeric - Global horizontal irradiance. [W/m^2] + Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric True (not refraction-corrected) zenith angles in decimal @@ -3742,9 +3742,9 @@ def louche(ghi, solar_zenith, datetime_or_doy, max_zenith=90): data: OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in W/m^2. + * ``dni``: the modeled direct normal irradiance in Wm⁻². * ``dhi``: the modeled diffuse horizontal irradiance in - W/m^2. + Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance on a horizontal plane. From 4b0c32dd9572f64f646beb238aca2cfaf5321e61 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:49:21 +0100 Subject: [PATCH 08/25] Update irradiance.py --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index b1297915d1..4f77685941 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -804,7 +804,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, finally :math:`\theta_T` is the tilt angle of the array. When supplying ``projection_ratio``, consider constraining its values - when zenith angle approaches 90 degrees or angle of incidence + when the zenith angle approaches 90 degrees or the angle of incidence projection is negative. See code for details. References From 10638048b8622c36eb97d94005d7f6cd93d389bf Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:14:56 +0100 Subject: [PATCH 09/25] add url to references --- pvlib/irradiance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 4f77685941..24cf521124 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -812,7 +812,8 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, .. [1] Hay, J.E., Davies, J.A., 1980. Calculations of the solar radiation incident on an inclined surface. In: Hay, J.E., Won, T.K. (Eds.), Proc. of First Canadian Solar Radiation Data Workshop, 59. - Ministry of Supply and Services, Canada. + Ministry of Supply and Services, Canada. Available from: + https://archive.org/details/proceedingsfirst00cana/mode/2up ''' # if necessary, calculate ratio of titled and horizontal beam irradiance From ca13315f70815eda66c5900fda9fec137775aa6d Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:21:31 +0100 Subject: [PATCH 10/25] Update irradiance.py --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 24cf521124..7082faf40a 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -809,7 +809,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, References ----------- - .. [1] Hay, J.E., Davies, J.A., 1980. Calculations of the solar + .. [1] Hay, J. E., Davies, J.A., 1980. Calculations of the solar radiation incident on an inclined surface. In: Hay, J.E., Won, T.K. (Eds.), Proc. of First Canadian Solar Radiation Data Workshop, 59. Ministry of Supply and Services, Canada. Available from: From 18ee5e81fddbc1e53ad109c66b33ec46fe74ad3c Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 30 Aug 2024 21:05:37 +0100 Subject: [PATCH 11/25] unit typesetting suggestion --- pvlib/irradiance.py | 74 ++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 7082faf40a..6727a8872e 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -602,7 +602,7 @@ def isotropic(surface_tilt, dhi): (e.g. surface facing up = 0, surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance in Wm⁻². DHI must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. Returns ------- @@ -663,10 +663,10 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, east of north (e.g. North = 0, South=180 East = 90, West = 270). dhi : numeric - Diffuse horizontal irradiance in Wm⁻². DHI must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. ghi : numeric - Global irradiance in Wm⁻². DNI must be >=0. + Global irradiance. [Wm⁻²] DNI must be >=0. solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal @@ -743,13 +743,13 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, South=180, East=90, West=270). dhi : numeric - Diffuse horizontal irradiance in Wm⁻². + Diffuse horizontal irradiance. [Wm⁻²] dni : numeric - Direct normal irradiance in Wm⁻². + Direct normal irradiance. [Wm⁻²] dni_extra : numeric - Extraterrestrial normal irradiance in Wm⁻². + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric, optional Solar apparent (refraction-corrected) zenith angles in decimal @@ -885,16 +885,16 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, South=180 East = 90, West = 270). dhi : numeric - diffuse horizontal irradiance in Wm⁻². + diffuse horizontal irradiance. [Wm⁻²] dni : numeric - direct normal irradiance in Wm⁻². + direct normal irradiance. [Wm⁻²] ghi: numeric - Global irradiance in Wm⁻². + Global irradiance. [Wm⁻²] dni_extra : numeric - Extraterrestrial normal irradiance in Wm⁻². + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -979,10 +979,10 @@ def king(surface_tilt, dhi, ghi, solar_zenith): surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance in Wm⁻². + Diffuse horizontal irradiance. [Wm⁻²] ghi : numeric - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -1036,13 +1036,13 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, east of north (e.g. North = 0, South=180 East = 90, West = 270). dhi : numeric - Diffuse horizontal irradiance in Wm⁻². DHI must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. dni : numeric - Direct normal irradiance in Wm⁻². DNI must be >=0. + Direct normal irradiance. [Wm⁻²] DNI must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance in Wm⁻². + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1302,13 +1302,13 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, east of north (e.g. North = 0, South=180 East = 90, West = 270). dhi : numeric - Diffuse horizontal irradiance in Wm⁻². dhi must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] dhi must be >=0. dni : numeric - Direct normal irradiance in Wm⁻². dni must be >=0. + Direct normal irradiance. [Wm⁻²] dni must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance in Wm⁻². + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1599,7 +1599,7 @@ def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): Parameters ---------- ghi : numeric - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] clearsky_ghi : numeric Modeled clearsky GHI @@ -1642,7 +1642,7 @@ def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, Parameters ---------- ghi : numeric - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric True (not refraction-corrected) solar zenith angle in decimal @@ -1755,7 +1755,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Parameters ---------- ghi : numeric - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric True (not refraction-corrected) solar zenith angles in decimal @@ -1901,7 +1901,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, Parameters ---------- ghi : array-like - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] solar_zenith : array-like True (not refraction-corrected) solar_zenith angles in decimal @@ -2143,13 +2143,13 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Parameters ---------- ghi : array-like - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] ghi_clearsky : array-like - Global horizontal irradiance from clear sky model, in Wm⁻². + Global horizontal irradiance from clear sky model,. [Wm⁻²] dni_clearsky : array-like - Direct normal irradiance from clear sky model, in Wm⁻². + Direct normal irradiance from clear sky model,. [Wm⁻²] zenith : array-like True (not refraction-corrected) zenith angles in decimal @@ -2188,7 +2188,7 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Returns ------- dni : array-like - The modeled direct normal irradiance in Wm⁻². + The modeled direct normal irradiance. [Wm⁻²] Notes ----- @@ -2240,7 +2240,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, Parameters ---------- poa_global : array-like - Plane of array global irradiance in Wm⁻². + Plane of array global irradiance. [Wm⁻²] aoi : array-like Angle of incidence of solar rays with respect to the module @@ -2307,8 +2307,8 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, data : DataFrame Contains the following keys/columns: - * ``ghi``: the modeled global horizontal irradiance in Wm⁻². - * ``dni``: the modeled direct normal irradiance in Wm⁻². + * ``ghi``: the modeled global horizontal irradiance. [Wm⁻²] + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². @@ -2572,7 +2572,7 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): Parameters ---------- ghi: numeric - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex @@ -2590,7 +2590,7 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in Wm⁻². + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2670,7 +2670,7 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array or pd.DatetimeIndex, optional @@ -2693,7 +2693,7 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in Wm⁻². + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2791,7 +2791,7 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance in Wm⁻². + Global horizontal irradiance. [Wm⁻²] zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex @@ -2811,7 +2811,7 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in Wm⁻². + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2906,7 +2906,7 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, data : OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in Wm⁻². + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -3743,7 +3743,7 @@ def louche(ghi, solar_zenith, datetime_or_doy, max_zenith=90): data: OrderedDict or DataFrame Contains the following keys/columns: - * ``dni``: the modeled direct normal irradiance in Wm⁻². + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance From 3a9b9659b5a241071a1dbdc10e878c887a796807 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:53:49 +0100 Subject: [PATCH 12/25] Update irradiance.py --- pvlib/irradiance.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 6727a8872e..4fcef4499b 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -721,7 +721,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, return_components=False): r''' Determine diffuse irradiance from the sky on a tilted surface using the - Hay and Davies (1980) model [1]_. + Hay and Davies (1980) model [1]_[2]_. The Hay and Davies model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this @@ -814,6 +814,10 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, (Eds.), Proc. of First Canadian Solar Radiation Data Workshop, 59. Ministry of Supply and Services, Canada. Available from: https://archive.org/details/proceedingsfirst00cana/mode/2up + .. [2] Loutzenhiser P.G. et. al. "Empirical validation of models to + compute solar irradiance on inclined surfaces for building energy + simulation" 2007, Solar Energy vol. 81. pp. 254-267 + :doi:'10.1016/j.solener.2006.03.009` ''' # if necessary, calculate ratio of titled and horizontal beam irradiance From 3037922494d605a003823904fe15147ff19bbe9e Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:01:46 +0100 Subject: [PATCH 13/25] Update irradiance.py --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 4fcef4499b..096e565974 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -721,7 +721,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, return_components=False): r''' Determine diffuse irradiance from the sky on a tilted surface using the - Hay and Davies (1980) model [1]_[2]_. + Hay and Davies (1980) model [1]_ [2]_. The Hay and Davies model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this @@ -817,7 +817,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, .. [2] Loutzenhiser P.G. et. al. "Empirical validation of models to compute solar irradiance on inclined surfaces for building energy simulation" 2007, Solar Energy vol. 81. pp. 254-267 - :doi:'10.1016/j.solener.2006.03.009` + :doi:`10.1016/j.solener.2006.03.009` ''' # if necessary, calculate ratio of titled and horizontal beam irradiance From 5012ee8b417357d912d86a7887538b78a1e2fe92 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:00:39 +0100 Subject: [PATCH 14/25] Update pvlib/irradiance.py Co-authored-by: Kevin Anderson --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 096e565974..3ed2ec55a8 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -799,8 +799,8 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, :math:`DHI` is the diffuse horizontal irradiance, :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, - :math:`R_b` is the projection ratio, which is defined as the cosine of the - ratio of angle of incidence (AOI) to the cosine of the zenith angle, and + :math:`R_b` is the projection ratio, which is defined as the ratio of the + cosine of angle of incidence (AOI) to the cosine of the zenith angle, and finally :math:`\theta_T` is the tilt angle of the array. When supplying ``projection_ratio``, consider constraining its values From a32cdf10672434cd118758ce1dc4f0dcfda5580b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:04:34 +0100 Subject: [PATCH 15/25] eqn typesetting --- pvlib/irradiance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 096e565974..ea3a7fc509 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -794,7 +794,8 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Davies sky diffuse model is as follows: .. math:: - I_{d} = DHI ( A\cdot R_b + (1 - A) (\frac{1 + \cos\theta_T}{2}) ). + I_{d} = DHI \left( A\cdot R_b + (1 - A) \left(\frac{ + 1 + \cos\theta_T}{2}\right ) \right ). :math:`DHI` is the diffuse horizontal irradiance, :math:`A` is the anisotropy index, which is the ratio of the direct normal From be8c252a48e632d94e5b9bf1fd13a23b10b8df11 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 3 Sep 2024 21:21:35 +0100 Subject: [PATCH 16/25] minor wording edits --- pvlib/irradiance.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 37acfa3577..a8df4a72b0 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -790,7 +790,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Notes ------ - The expression for the diffuse irradiance, :math:`I_d` in the Hay and + The expression for the diffuse irradiance, :math:`I_d`, in the Hay and Davies sky diffuse model is as follows: .. math:: @@ -801,12 +801,12 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is defined as the ratio of the - cosine of angle of incidence (AOI) to the cosine of the zenith angle, and - finally :math:`\theta_T` is the tilt angle of the array. + cosine of the angle of incidence (AOI) to the cosine of the zenith angle, + and finally :math:`\theta_T` is the tilt angle of the array. When supplying ``projection_ratio``, consider constraining its values - when the zenith angle approaches 90 degrees or the angle of incidence - projection is negative. See code for details. + when the zenith angle approaches 90 degrees or the AOI projection is + negative. See code for details. References ----------- From ce73fbb4cb27184722021b586243fccd14ed5393 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:54:20 +0100 Subject: [PATCH 17/25] Update v0.11.1.rst --- docs/sphinx/source/whatsnew/v0.11.1.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.11.1.rst b/docs/sphinx/source/whatsnew/v0.11.1.rst index 832e1a7221..b51ac9f522 100644 --- a/docs/sphinx/source/whatsnew/v0.11.1.rst +++ b/docs/sphinx/source/whatsnew/v0.11.1.rst @@ -44,15 +44,14 @@ Documentation * Added gallery example demonstrating the application of several spectral mismatch factor models. (:issue:`2107`, :pull:`2114`) - * Added gallery example on calculating cell temperature for floating PV. (:pull:`2110`) - * Added gallery example demonstrating how to use different Perez coefficients in a ModelChain. (:issue:`2127`, :pull:`2148`) - * Removed unused "times" input from dni_et() function (:issue:`2105`) +* Updated :py:func:`pvlib.irradiance.haydavies` to include equation variable + definitions and a new "notes" section (:issue:`2183`, :pull:`2191`) Requirements ~~~~~~~~~~~~ From 39a7ddb906ec783e3682b4fbda29b7bb98062831 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:06:26 +0100 Subject: [PATCH 18/25] Update irradiance.py adjust units Co-Authored-By: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 10bf5f1bda..f2eb0e2275 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -529,7 +529,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): (e.g. surface facing up = 0, surface facing horizon = 90). ghi : numeric - Global horizontal irradiance. :math:`Wm⁻²` + Global horizontal irradiance. [Wm⁻²] albedo : numeric, default 0.25 Ground reflectance, typically 0.1-0.4 for surfaces on Earth @@ -546,7 +546,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): Returns ------- grounddiffuse : numeric - Ground reflected irradiance. :math:`Wm⁻²` + Ground reflected irradiance. [Wm⁻²] Notes ----- From 8df6115f59509729fe26c9728324befff9035fae Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:11:25 +0100 Subject: [PATCH 19/25] Update irradiance.py --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index f2eb0e2275..5ec4340b6c 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -1267,8 +1267,8 @@ def _f(i, j, zeta): [+0.328, +0.471, -0.216, +0.069, -0.105, -0.028], [+0.557, +0.241, -0.300, +0.086, -0.085, -0.012], [+0.861, -0.323, -0.355, +0.240, -0.467, -0.008], - [ 1.212, -1.239, -0.444, +0.305, -0.797, +0.047], - [ 1.099, -1.847, -0.365, +0.275, -1.132, +0.124], + [+1.212, -1.239, -0.444, +0.305, -0.797, +0.047], + [+1.099, -1.847, -0.365, +0.275, -1.132, +0.124], [+0.544, +0.157, -0.213, +0.118, -1.455, +0.292], [+0.544, +0.157, -0.213, +0.118, -1.455, +0.292], [+0.000, +0.000, +0.000, +0.000, +0.000, +0.000], From faab882b841978900ea9bcdb760220cbe7edd63b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:36:45 +0100 Subject: [PATCH 20/25] \theta_T -> \beta --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 5ec4340b6c..788895e7ba 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -795,14 +795,14 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, .. math:: I_{d} = DHI \left( A\cdot R_b + (1 - A) \left(\frac{ - 1 + \cos\theta_T}{2}\right ) \right ). + 1 + \cos\beta}{2}\right ) \right ). :math:`DHI` is the diffuse horizontal irradiance, :math:`A` is the anisotropy index, which is the ratio of the direct normal irradiance to the extraterrestrial irradiation, :math:`R_b` is the projection ratio, which is defined as the ratio of the cosine of the angle of incidence (AOI) to the cosine of the zenith angle, - and finally :math:`\theta_T` is the tilt angle of the array. + and finally :math:`\beta` is the tilt angle of the array. When supplying ``projection_ratio``, consider constraining its values when the zenith angle approaches 90 degrees or the AOI projection is From ef54fe9432d20fcc5c212fe3f2ca3b3133c2c8a6 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:28:02 +0100 Subject: [PATCH 21/25] add last accessed to reference --- pvlib/irradiance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 788895e7ba..db57da419b 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -810,12 +810,13 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, References ----------- - .. [1] Hay, J. E., Davies, J.A., 1980. Calculations of the solar + .. [1] Hay, J. E., Davies, J. A., 1980. Calculations of the solar radiation incident on an inclined surface. In: Hay, J.E., Won, T.K. (Eds.), Proc. of First Canadian Solar Radiation Data Workshop, 59. Ministry of Supply and Services, Canada. Available from: https://archive.org/details/proceedingsfirst00cana/mode/2up - .. [2] Loutzenhiser P.G. et. al. "Empirical validation of models to + (Last accessed: 17/09/24) + .. [2] Loutzenhiser P. G. et. al. "Empirical validation of models to compute solar irradiance on inclined surfaces for building energy simulation" 2007, Solar Energy vol. 81. pp. 254-267 :doi:`10.1016/j.solener.2006.03.009` From 095f348f0f55d98039c8752345429285c0513ca5 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:29:53 +0100 Subject: [PATCH 22/25] remove spurious period --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index db57da419b..671d092b29 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -816,7 +816,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Ministry of Supply and Services, Canada. Available from: https://archive.org/details/proceedingsfirst00cana/mode/2up (Last accessed: 17/09/24) - .. [2] Loutzenhiser P. G. et. al. "Empirical validation of models to + .. [2] Loutzenhiser P. G. et al. "Empirical validation of models to compute solar irradiance on inclined surfaces for building energy simulation" 2007, Solar Energy vol. 81. pp. 254-267 :doi:`10.1016/j.solener.2006.03.009` From 67d5b4b6abee81d5240bfcd957fbd4f6ae81fd0f Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:49:09 +0100 Subject: [PATCH 23/25] Apply suggestions from code review Co-authored-by: Kevin Anderson --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 671d092b29..5febcf7d34 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -2152,10 +2152,10 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Global horizontal irradiance. [Wm⁻²] ghi_clearsky : array-like - Global horizontal irradiance from clear sky model,. [Wm⁻²] + Global horizontal irradiance from clear sky model. [Wm⁻²] dni_clearsky : array-like - Direct normal irradiance from clear sky model,. [Wm⁻²] + Direct normal irradiance from clear sky model. [Wm⁻²] zenith : array-like True (not refraction-corrected) zenith angles in decimal From d142df93e83c3f9dcfcd0b2a70c775541482b395 Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:06:25 +0100 Subject: [PATCH 24/25] Update irradiance.py Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> --- pvlib/irradiance.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 5febcf7d34..340253f7ed 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -773,9 +773,9 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Returns -------- numeric, OrderedDict, or DataFrame - Return type controlled by `return_components` argument. - If ``return_components=False``, `sky_diffuse` is returned. - If ``return_components=True``, `diffuse_components` is returned. + Return type controlled by ``return_components`` argument. + If `False`, ``sky_diffuse`` is returned. + If `True`, ``diffuse_components`` is returned. sky_diffuse : numeric The sky diffuse component of the solar radiation on a tilted @@ -790,8 +790,8 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Notes ------ - The expression for the diffuse irradiance, :math:`I_d`, in the Hay and - Davies sky diffuse model is as follows: + In the Hay and Davies (1980) model, sky diffuse irradiance, :math:`I_d`, + is as follows: .. math:: I_{d} = DHI \left( A\cdot R_b + (1 - A) \left(\frac{ @@ -804,7 +804,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, cosine of the angle of incidence (AOI) to the cosine of the zenith angle, and finally :math:`\beta` is the tilt angle of the array. - When supplying ``projection_ratio``, consider constraining its values + If supplying ``projection_ratio``, consider constraining its values when the zenith angle approaches 90 degrees or the AOI projection is negative. See code for details. From 4eb06afadff39f6b812dc0d88d2b7f4159d56ada Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:24:56 +0100 Subject: [PATCH 25/25] Update irradiance.py --- pvlib/irradiance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 340253f7ed..77f9ead91f 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -766,9 +766,9 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, projection. Must supply ``solar_zenith`` and ``solar_azimuth`` or supply ``projection_ratio``. - return_components : bool, default False - Flag used to decide whether to return the calculated diffuse components - or not. + return_components : bool, default `False` + If `False`, ``sky_diffuse`` is returned. + If `True`, ``diffuse_components`` is returned. Returns --------