From ce3d9b5643b3ac17abec0e7ee7c0e92da4587f13 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 26 Nov 2024 21:19:25 -0700 Subject: [PATCH 01/15] Update irradiance.py --- pvlib/irradiance.py | 63 +++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index cecba6237b..dbdfd851ae 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -41,7 +41,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Day of year, array of days of year, or datetime-like object solar_constant : float, default 1366.1 - The solar constant. + The solar constant. [Wm⁻²] method : string, default 'spencer' The method by which the ET radiation should be calculated. @@ -61,7 +61,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, The extraterrestrial radiation present in watts per square meter on a surface which is normal to the sun. Pandas Timestamp and DatetimeIndex inputs will yield a Pandas TimeSeries. All other - inputs will yield a float or an array of floats. + inputs will yield a float or an array of floats. See :term:`dni_extra`. References ---------- @@ -162,18 +162,19 @@ def aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth): Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. + Panel tilt from horizontal [°]. See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north. + Panel azimuth from north [°]. See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle. + Solar zenith angle. See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle. + Solar azimuth angle. See :term:`solar_azimuth`. Returns ------- projection : numeric Dot product of panel normal and solar angle. + See :term:`aoi_projection`. """ projection = ( @@ -202,18 +203,18 @@ def aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth): Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. + Panel tilt from horizontal [°]. See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north. + Panel azimuth from north [°]. See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle. + Solar zenith angle [°]. See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle. + Solar azimuth angle [°]. See :term:`solar_azimuth`. Returns ------- aoi : numeric - Angle of incidence in degrees. + Angle of incidence [°]. See :term:`aoi`. """ projection = aoi_projection(surface_tilt, surface_azimuth, @@ -236,20 +237,20 @@ def beam_component(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. + Panel tilt from horizontal [°]. See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north. + Panel azimuth from north [°]. See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle. + Solar zenith angle [°]. See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle. + Solar azimuth angle [°]. See :term:`solar_azimuth`. dni : numeric - Direct normal irradiance, see :term:`dni`. [Wm⁻²] + Direct normal irradiance [Wm⁻²]. See :term:`dni`. Returns ------- beam : numeric - Beam component + Beam component [Wm⁻²]. """ beam = dni * aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth) @@ -284,21 +285,21 @@ def get_total_irradiance(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [degree] + Panel tilt from horizontal [°]. See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north. [degree] + Panel azimuth from north [°]. See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle. [degree] + Solar zenith angle [°]. See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle. [degree] + Solar azimuth angle [°]. See :term:`solar_azimuth`. dni : numeric - Direct Normal Irradiance. [W/m2] + Direct normal irradiance [Wm⁻²]. See :term:`dni`. ghi : numeric - Global horizontal irradiance. [W/m2] + Global horizontal irradiance. [Wm⁻²] dhi : numeric - Diffuse horizontal irradiance. [W/m2] + Diffuse horizontal irradiance. [Wm⁻²] dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [W/m2] + Extraterrestrial direct normal irradiance. [Wm⁻²] airmass : numeric, optional Relative airmass (not adjusted for pressure). [unitless] albedo : numeric, default 0.25 @@ -371,13 +372,13 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, solar_azimuth : numeric Solar azimuth angle. [degree] dni : numeric - Direct Normal Irradiance. [W/m2] + Direct Normal Irradiance. [Wm⁻²] ghi : numeric - Global horizontal irradiance. [W/m2] + Global horizontal irradiance. [Wm⁻²] dhi : numeric - Diffuse horizontal irradiance. [W/m2] + Diffuse horizontal irradiance. [Wm⁻²] dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [W/m2] + Extraterrestrial direct normal irradiance. [Wm⁻²] airmass : numeric, optional Relative airmass (not adjusted for pressure). [unitless] model : str, default 'isotropic' @@ -390,7 +391,7 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, Returns ------- poa_sky_diffuse : numeric - Sky diffuse irradiance in the plane of array. [W/m2] + Sky diffuse irradiance in the plane of array. [Wm⁻²] Raises ------ @@ -2823,7 +2824,7 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [W/m2] + Extraterrestrial direct normal irradiance. [Wm⁻²] min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global clearness index `kt`. Equivalent to zenith = 86.273 degrees. From 89e7e7148b6a32d49655e908ed88baa2a728459a Mon Sep 17 00:00:00 2001 From: RDaxini Date: Tue, 26 Nov 2024 21:35:04 -0700 Subject: [PATCH 02/15] ongoing... --- pvlib/irradiance.py | 138 +++++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 67 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index dbdfd851ae..29db0ce5a5 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -41,7 +41,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Day of year, array of days of year, or datetime-like object solar_constant : float, default 1366.1 - The solar constant. [Wm⁻²] + The solar constant [Wm⁻²]. method : string, default 'spencer' The method by which the ET radiation should be calculated. @@ -293,17 +293,19 @@ def get_total_irradiance(surface_tilt, surface_azimuth, solar_azimuth : numeric Solar azimuth angle [°]. See :term:`solar_azimuth`. dni : numeric - Direct normal irradiance [Wm⁻²]. See :term:`dni`. + Direct normal irradiance [Wm⁻²]. See :term:`dni`. ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. See :term:`ghi`. dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] + Diffuse horizontal irradiance [Wm⁻²]. See :term:`dhi`. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] + Extraterrestrial direct normal irradiance [Wm⁻²]. + See :term:`dni_extra`. airmass : numeric, optional - Relative airmass (not adjusted for pressure). [unitless] + Relative airmass (not adjusted for pressure) [unitless]. + See :term:`airmass`. albedo : numeric, default 0.25 - Ground surface albedo. [unitless] + Ground surface albedo [unitless]. See :term:`albedo`. surface_type : str, optional Surface type. See :py:func:`~pvlib.irradiance.get_ground_diffuse` for the list of accepted values. @@ -364,23 +366,25 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [degree] + Panel tilt from horizontal [°]. See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north. [degree] + Panel azimuth from north [°]. See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle. [degree] + Solar zenith angle [°]. See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle. [degree] + Solar azimuth angle [°]. See :term:`solar_azimuth`. dni : numeric - Direct Normal Irradiance. [Wm⁻²] + Direct normal irradiance [Wm⁻²]. See :term:`dni`. ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. See :term:`ghi`. dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] + Diffuse horizontal irradiance [Wm⁻²]. See :term:`dhi`. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] + Extraterrestrial direct normal irradiance [Wm⁻²]. + See :term:`dni_extra`. airmass : numeric, optional - Relative airmass (not adjusted for pressure). [unitless] + Relative airmass (not adjusted for pressure) [unitless]. + See :term:`airmass`. model : str, default 'isotropic' Irradiance model. Can be one of ``'isotropic'``, ``'klucher'``, ``'haydavies'``, ``'reindl'``, ``'king'``, ``'perez'``, @@ -391,7 +395,7 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, Returns ------- poa_sky_diffuse : numeric - Sky diffuse irradiance in the plane of array. [Wm⁻²] + Sky diffuse irradiance in the plane of array [Wm⁻²]. Raises ------ @@ -530,7 +534,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. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. albedo : numeric, default 0.25 Ground reflectance, typically 0.1-0.4 for surfaces on Earth @@ -547,7 +551,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): Returns ------- grounddiffuse : numeric - Ground reflected irradiance. [Wm⁻²] + Ground reflected irradiance [Wm⁻²]. Notes ----- @@ -603,7 +607,7 @@ def isotropic(surface_tilt, dhi): (e.g. surface facing up = 0, surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. + Diffuse horizontal irradiance [Wm⁻²]. DHI must be >=0. Returns ------- @@ -646,10 +650,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, must be >=0. [Wm⁻²] + Diffuse horizontal irradiance, must be >=0 [Wm⁻²]. ghi : numeric - Global horizontal irradiance, must be >=0. [Wm⁻²] + Global horizontal irradiance, must be >=0 [Wm⁻²]. solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal @@ -663,7 +667,7 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, Returns ------- diffuse : numeric - The sky diffuse component of the solar radiation. [Wm⁻²] + The sky diffuse component of the solar radiation [Wm⁻²]. Notes ----- @@ -750,13 +754,13 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, South=180, East=90, West=270). dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] + Diffuse horizontal irradiance [Wm⁻²]. dni : numeric - Direct normal irradiance, see :term:`dni`. [Wm⁻²] + Direct normal irradiance, see :term:`dni` [Wm⁻²]. dni_extra : numeric - Extraterrestrial normal irradiance. [Wm⁻²] + Extraterrestrial normal irradiance [Wm⁻²]. solar_zenith : numeric, optional Solar apparent (refraction-corrected) zenith angles in decimal @@ -893,16 +897,16 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, South=180 East = 90, West = 270). dhi : numeric - diffuse horizontal irradiance. [Wm⁻²] + diffuse horizontal irradiance [Wm⁻²]. dni : numeric - direct normal irradiance. [Wm⁻²] + direct normal irradiance [Wm⁻²]. ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. dni_extra : numeric - Extraterrestrial normal irradiance. [Wm⁻²] + Extraterrestrial normal irradiance [Wm⁻²]. solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -1005,10 +1009,10 @@ def king(surface_tilt, dhi, ghi, solar_zenith): surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] + Diffuse horizontal irradiance [Wm⁻²]. ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -1062,13 +1066,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. [Wm⁻²] DHI must be >=0. + Diffuse horizontal irradiance [Wm⁻²]. DHI must be >=0. dni : numeric - Direct normal irradiance. [Wm⁻²] DNI must be >=0. + Direct normal irradiance [Wm⁻²]. DNI must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance. [Wm⁻²] + Extraterrestrial normal irradiance [Wm⁻²]. solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1328,13 +1332,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. [Wm⁻²] dhi must be >=0. + Diffuse horizontal irradiance [Wm⁻²]. dhi must be >=0. dni : numeric - Direct normal irradiance. [Wm⁻²] dni must be >=0. + Direct normal irradiance [Wm⁻²]. dni must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance. [Wm⁻²] + Extraterrestrial normal irradiance [Wm⁻²]. solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1549,16 +1553,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. [Wm⁻²] + Plane-of-array global irradiance, aka global tilted irradiance [Wm⁻²]. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] + Extraterrestrial direct normal irradiance [Wm⁻²]. airmass : numeric, optional - Relative airmass (not adjusted for pressure). [unitless] + Relative airmass (not adjusted for pressure) [unitless]. albedo : numeric, default 0.25 - Ground surface albedo. [unitless] + 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. [Wm⁻²] + 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). @@ -1566,7 +1570,7 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, Returns ------- ghi : numeric - Estimated GHI. [Wm⁻²] + Estimated GHI [Wm⁻²]. converged : boolean, optional Present if full_output=True. Indicates which elements converged successfully. @@ -1625,7 +1629,7 @@ def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. clearsky_ghi : numeric Modeled clearsky GHI @@ -1668,7 +1672,7 @@ def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. solar_zenith : numeric True (not refraction-corrected) solar zenith angle in decimal @@ -1781,7 +1785,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. solar_zenith : numeric True (not refraction-corrected) solar zenith angles in decimal @@ -1927,7 +1931,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, Parameters ---------- ghi : array-like - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. solar_zenith : array-like True (not refraction-corrected) solar_zenith angles in decimal @@ -2169,13 +2173,13 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Parameters ---------- ghi : array-like - Global horizontal irradiance. [Wm⁻²] + 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 @@ -2214,7 +2218,7 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Returns ------- dni : array-like - The modeled direct normal irradiance. [Wm⁻²] + The modeled direct normal irradiance [Wm⁻²]. Notes ----- @@ -2266,7 +2270,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, Parameters ---------- poa_global : array-like - Plane of array global irradiance. [Wm⁻²] + Plane of array global irradiance [Wm⁻²]. aoi : array-like Angle of incidence of solar rays with respect to the module @@ -2312,7 +2316,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, applied. albedo : numeric, default 0.25 - Ground surface albedo. [unitless] + Ground surface albedo [unitless]. model : String, default 'perez' Irradiance model. See :py:func:`get_sky_diffuse` for allowed values. @@ -2333,8 +2337,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. [Wm⁻²] - * ``dni``: the modeled direct normal irradiance. [Wm⁻²] + * ``ghi``: the modeled global horizontal irradiance [Wm⁻²]. + * ``dni``: the modeled direct normal irradiance [Wm⁻²]. * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². @@ -2598,7 +2602,7 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): Parameters ---------- ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex @@ -2616,7 +2620,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. [Wm⁻²] + * ``dni``: the modeled direct normal irradiance [Wm⁻²]. * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2696,7 +2700,7 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance. [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 @@ -2719,7 +2723,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. [Wm⁻²] + * ``dni``: the modeled direct normal irradiance [Wm⁻²]. * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2817,14 +2821,14 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] + Extraterrestrial direct normal irradiance [Wm⁻²]. min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global clearness index `kt`. Equivalent to zenith = 86.273 degrees. @@ -2837,7 +2841,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. [Wm⁻²] + * ``dni``: the modeled direct normal irradiance [Wm⁻²]. * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2910,7 +2914,7 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, Parameters ---------- ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. solar_zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : numeric, pandas.DatetimeIndex @@ -2932,7 +2936,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. [Wm⁻²] + * ``dni``: the modeled direct normal irradiance [Wm⁻²]. * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -3754,7 +3758,7 @@ def louche(ghi, solar_zenith, datetime_or_doy, max_zenith=90): Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance [Wm⁻²]. solar_zenith : numeric True (not refraction-corrected) zenith angles in decimal @@ -3769,7 +3773,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. [Wm⁻²] + * ``dni``: the modeled direct normal irradiance [Wm⁻²]. * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance From 4f78af50bb852b8e8a482a09b2e4b4f5028d6d60 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 6 Dec 2024 15:10:56 -0700 Subject: [PATCH 03/15] ongoing... --- pvlib/irradiance.py | 87 +++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 38 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 29db0ce5a5..f598c6c040 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -465,18 +465,18 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): ---------- aoi : numeric Angle of incidence of solar rays with respect to the module - surface, from :func:`aoi`. + surface, from :func:`aoi` [°]. See :term:`aoi`. dni : numeric - Direct normal irradiance (Wm⁻²), as measured from a TMY file or - calculated with a clearsky model. + Direct normal irradiance [Wm⁻²], as measured from a TMY file or + calculated with a clearsky model. See :term:`dni`. poa_sky_diffuse : numeric - Diffuse irradiance (Wm⁻²) in the plane of the modules, as - calculated by a diffuse irradiance translation function + Diffuse irradiance [Wm⁻²] in the plane of the modules, as + calculated by a diffuse irradiance translation function. poa_ground_diffuse : numeric - Ground reflected irradiance (Wm⁻²) 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 @@ -484,12 +484,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 (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_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 - (Wm⁻²) + [Wm⁻²] Notes ------ @@ -1545,13 +1545,13 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [degree] + Panel tilt from horizontal. [°] surface_azimuth : numeric - Panel azimuth from north. [degree] + Panel azimuth from north. [°] solar_zenith : numeric - Solar zenith angle. [degree] + Solar zenith angle. [°] solar_azimuth : numeric - Solar azimuth angle. [degree] + Solar azimuth angle. [°] poa_global : numeric Plane-of-array global irradiance, aka global tilted irradiance [Wm⁻²]. dni_extra : numeric, optional @@ -3707,24 +3707,35 @@ def complete_irradiance(solar_zenith, Parameters ---------- - solar_zenith : Series - Zenith angles in decimal degrees, with datetime index. + solar_zenith : series + Solar zenith angle [°], with datetime index. Angles must be >=0 and <=180. Must have the same datetime index - as ghi, dhi, and dni series, when available. + as ghi, dhi, and dni series, when available. See :term:`solar_zenith`. ghi : Series, optional - Pandas series of dni data, with datetime index. Must have the same - datetime index as dni, dhi, and zenith series, when available. + Pandas series of dni data [Wm⁻²], with datetime index. Must have the + same datetime index as dni, dhi, and zenith series, when available. + See :term:`ghi`. dhi : Series, optional - Pandas series of dni data, with datetime index. Must have the same - datetime index as ghi, dni, and zenith series, when available. + Pandas series of dni data [Wm⁻²], with datetime index. Must have the + same datetime index as ghi, dni, and zenith series, when available. + See :term:`dhi`. dni : Series, optional - Pandas series of dni data, with datetime index. Must have the same - datetime index as ghi, dhi, and zenith series, when available. + Pandas series of dni data [Wm⁻²], with datetime index. Must have the + same datetime index as ghi, dhi, and zenith series, when available. + See :term:`dni`. dni_clear : Series, optional - Pandas series of clearsky dni data. Must have the same datetime index - as ghi, dhi, dni, and zenith series, when available. See - :py:func:`dni` for details. - + Pandas series of clearsky dni data [Wm⁻²]. Must have the same datetime + index as ghi, dhi, dni, and zenith series, when available. See + :py:func:`dni` for details. See :term:`dni_clear` for glossary + definition. + + +solar_azimuth : numeric + Solar azimuth angle. [°] +poa_global : numeric + Plane-of-array global irradiance, aka global tilted irradiance . +dni_extra : numeric, optional + Extraterrestrial direct normal irradiance [Wm⁻²]. Returns ------- component_sum_df : Dataframe @@ -3758,11 +3769,11 @@ def louche(ghi, solar_zenith, datetime_or_doy, max_zenith=90): Parameters ---------- ghi : numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance [Wm⁻²]. See :term:`ghi`. solar_zenith : numeric - True (not refraction-corrected) zenith angles in decimal - degrees. Angles must be >=0 and <=90. + True (not refraction-corrected) zenith angles [°]. + Angles must be >=0° and <=90°. See :term:`solar_zenith`. datetime_or_doy : numeric, pandas.DatetimeIndex Day of year or array of days of year e.g. @@ -3773,11 +3784,11 @@ 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 [Wm⁻²]. - * ``dhi``: the modeled diffuse horizontal irradiance in - Wm⁻². - * ``kt``: Ratio of global to extraterrestrial irradiance - on a horizontal plane. + * ``dni``: the modeled direct normal irradiance [Wm⁻²]. See :term:`dni` + * ``dhi``: the modeled diffuse horizontal irradiance [Wm⁻²]. + See :term:`dhi` + * ``kt``: Clearness index [unitless], ratio of global to + extraterrestrial irradiance on a horizontal plane. References ------- @@ -3822,12 +3833,12 @@ def diffuse_par_spitters(daily_solar_zenith, global_diffuse_fraction): .. note:: The diffuse fraction is defined as the ratio of - diffuse to global daily insolation, in J m⁻² day⁻¹ or equivalent. + diffuse to global daily insolation, in Jm⁻² day⁻¹ or equivalent. Parameters ---------- daily_solar_zenith : numeric - Average daily solar zenith angle. In degrees [°]. + Average daily solar zenith angle [°]. global_diffuse_fraction : numeric Fraction of daily global broadband insolation that is diffuse. From 91d4a011b07d3e97e5b62e2a7bb0ee65d1e78c1e Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 3 Jan 2025 10:54:02 -0700 Subject: [PATCH 04/15] fix . + [ ] --- pvlib/irradiance.py | 216 ++++++++++++++++++++++---------------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index f598c6c040..4a20aee25c 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -41,7 +41,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Day of year, array of days of year, or datetime-like object solar_constant : float, default 1366.1 - The solar constant [Wm⁻²]. + The solar constant. [Wm⁻²] method : string, default 'spencer' The method by which the ET radiation should be calculated. @@ -69,7 +69,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Clear Sky Models: Implementation and Analysis", Sandia National Laboratories, SAND2012-2389, 2012. - .. [2] http://solardata.uoregon.edu/SolarRadiationBasics.html, Eqs. + .. [2] http://solardatauoregon.edu/SolarRadiationBasics.html, Eqs. SR1 and SR2 .. [3] Partridge, G. W. and Platt, C. M. R. 1976. Radiative Processes @@ -162,9 +162,9 @@ def aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth): Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal [°]. See :term:`surface_tilt`. + Panel tilt from horizontal. [°] See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north [°]. See :term:`surface_azimuth`. + Panel azimuth from north. [°] See :term:`surface_azimuth`. solar_zenith : numeric Solar zenith angle. See :term:`solar_zenith`. solar_azimuth : numeric @@ -203,18 +203,18 @@ def aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth): Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal [°]. See :term:`surface_tilt`. + Panel tilt from horizontal. [°] See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north [°]. See :term:`surface_azimuth`. + Panel azimuth from north. [°] See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle [°]. See :term:`solar_zenith`. + Solar zenith angle. [°] See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle [°]. See :term:`solar_azimuth`. + Solar azimuth angle. [°] See :term:`solar_azimuth`. Returns ------- aoi : numeric - Angle of incidence [°]. See :term:`aoi`. + Angle of incidence. [°] See :term:`aoi`. """ projection = aoi_projection(surface_tilt, surface_azimuth, @@ -237,20 +237,20 @@ def beam_component(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal [°]. See :term:`surface_tilt`. + Panel tilt from horizontal. [°] See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north [°]. See :term:`surface_azimuth`. + Panel azimuth from north. [°] See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle [°]. See :term:`solar_zenith`. + Solar zenith angle. [°] See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle [°]. See :term:`solar_azimuth`. + Solar azimuth angle. [°] See :term:`solar_azimuth`. dni : numeric - Direct normal irradiance [Wm⁻²]. See :term:`dni`. + Direct normal irradiance. [Wm⁻²] See :term:`dni`. Returns ------- beam : numeric - Beam component [Wm⁻²]. + Beam component. [Wm⁻²] """ beam = dni * aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth) @@ -285,27 +285,27 @@ def get_total_irradiance(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal [°]. See :term:`surface_tilt`. + Panel tilt from horizontal. [°] See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north [°]. See :term:`surface_azimuth`. + Panel azimuth from north. [°] See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle [°]. See :term:`solar_zenith`. + Solar zenith angle. [°] See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle [°]. See :term:`solar_azimuth`. + Solar azimuth angle. [°] See :term:`solar_azimuth`. dni : numeric - Direct normal irradiance [Wm⁻²]. See :term:`dni`. + Direct normal irradiance. [Wm⁻²] See :term:`dni`. ghi : numeric - Global horizontal irradiance [Wm⁻²]. See :term:`ghi`. + Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. dhi : numeric - Diffuse horizontal irradiance [Wm⁻²]. See :term:`dhi`. + Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance [Wm⁻²]. + Extraterrestrial direct normal irradiance. [Wm⁻²] See :term:`dni_extra`. airmass : numeric, optional - Relative airmass (not adjusted for pressure) [unitless]. + Relative airmass (not adjusted for pressure). [unitless] See :term:`airmass`. albedo : numeric, default 0.25 - Ground surface albedo [unitless]. See :term:`albedo`. + Ground surface albedo. [unitless] See :term:`albedo`. surface_type : str, optional Surface type. See :py:func:`~pvlib.irradiance.get_ground_diffuse` for the list of accepted values. @@ -366,24 +366,24 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal [°]. See :term:`surface_tilt`. + Panel tilt from horizontal. [°] See :term:`surface_tilt`. surface_azimuth : numeric - Panel azimuth from north [°]. See :term:`surface_azimuth`. + Panel azimuth from north. [°] See :term:`surface_azimuth`. solar_zenith : numeric - Solar zenith angle [°]. See :term:`solar_zenith`. + Solar zenith angle. [°] See :term:`solar_zenith`. solar_azimuth : numeric - Solar azimuth angle [°]. See :term:`solar_azimuth`. + Solar azimuth angle. [°] See :term:`solar_azimuth`. dni : numeric - Direct normal irradiance [Wm⁻²]. See :term:`dni`. + Direct normal irradiance. [Wm⁻²] See :term:`dni`. ghi : numeric - Global horizontal irradiance [Wm⁻²]. See :term:`ghi`. + Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. dhi : numeric - Diffuse horizontal irradiance [Wm⁻²]. See :term:`dhi`. + Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance [Wm⁻²]. + Extraterrestrial direct normal irradiance. [Wm⁻²] See :term:`dni_extra`. airmass : numeric, optional - Relative airmass (not adjusted for pressure) [unitless]. + Relative airmass (not adjusted for pressure). [unitless] See :term:`airmass`. model : str, default 'isotropic' Irradiance model. Can be one of ``'isotropic'``, ``'klucher'``, @@ -395,7 +395,7 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, Returns ------- poa_sky_diffuse : numeric - Sky diffuse irradiance in the plane of array [Wm⁻²]. + Sky diffuse irradiance in the plane of array. [Wm⁻²] Raises ------ @@ -465,10 +465,10 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): ---------- aoi : numeric Angle of incidence of solar rays with respect to the module - surface, from :func:`aoi` [°]. See :term:`aoi`. + surface, from :func:`aoi`. [°] See :term:`aoi`. dni : numeric - Direct normal irradiance [Wm⁻²], as measured from a TMY file or + Direct normal irradiance. [Wm⁻²], as measured from a TMY file or calculated with a clearsky model. See :term:`dni`. poa_sky_diffuse : numeric @@ -484,12 +484,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 [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_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 - [Wm⁻²] + . [Wm⁻²] Notes ------ @@ -534,7 +534,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 [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] albedo : numeric, default 0.25 Ground reflectance, typically 0.1-0.4 for surfaces on Earth @@ -551,7 +551,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): Returns ------- grounddiffuse : numeric - Ground reflected irradiance [Wm⁻²]. + Ground reflected irradiance. [Wm⁻²] Notes ----- @@ -607,7 +607,7 @@ def isotropic(surface_tilt, dhi): (e.g. surface facing up = 0, surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance [Wm⁻²]. DHI must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. Returns ------- @@ -650,10 +650,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, must be >=0 [Wm⁻²]. + Diffuse horizontal irradiance, must be >=0. [Wm⁻²] ghi : numeric - Global horizontal irradiance, must be >=0 [Wm⁻²]. + Global horizontal irradiance, must be >=0. [Wm⁻²] solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal @@ -667,7 +667,7 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, Returns ------- diffuse : numeric - The sky diffuse component of the solar radiation [Wm⁻²]. + The sky diffuse component of the solar radiation. [Wm⁻²] Notes ----- @@ -754,13 +754,13 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, South=180, East=90, West=270). dhi : numeric - Diffuse horizontal irradiance [Wm⁻²]. + Diffuse horizontal irradiance. [Wm⁻²] dni : numeric - Direct normal irradiance, see :term:`dni` [Wm⁻²]. + Direct normal irradiance, see :term:`dni`. [Wm⁻²] dni_extra : numeric - Extraterrestrial normal irradiance [Wm⁻²]. + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric, optional Solar apparent (refraction-corrected) zenith angles in decimal @@ -897,16 +897,16 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, South=180 East = 90, West = 270). dhi : numeric - diffuse horizontal irradiance [Wm⁻²]. + diffuse horizontal irradiance. [Wm⁻²] dni : numeric - direct normal irradiance [Wm⁻²]. + direct normal irradiance. [Wm⁻²] ghi: numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] dni_extra : numeric - Extraterrestrial normal irradiance [Wm⁻²]. + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -1009,10 +1009,10 @@ def king(surface_tilt, dhi, ghi, solar_zenith): surface facing horizon = 90) dhi : numeric - Diffuse horizontal irradiance [Wm⁻²]. + Diffuse horizontal irradiance. [Wm⁻²] ghi : numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric Apparent (refraction-corrected) zenith angles in decimal degrees. @@ -1066,13 +1066,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 [Wm⁻²]. DHI must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. dni : numeric - Direct normal irradiance [Wm⁻²]. DNI must be >=0. + Direct normal irradiance. [Wm⁻²] DNI must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance [Wm⁻²]. + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1332,13 +1332,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 [Wm⁻²]. dhi must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] dhi must be >=0. dni : numeric - Direct normal irradiance [Wm⁻²]. dni must be >=0. + Direct normal irradiance. [Wm⁻²] dni must be >=0. dni_extra : numeric - Extraterrestrial normal irradiance [Wm⁻²]. + Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric apparent (refraction-corrected) zenith angles in decimal @@ -1384,7 +1384,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, 1990 Perez model using the ``'allsitescomposite1990'`` coefficient set. Deviations between the two are very small, as demonstrated in [1]_. Other coefficient sets are not supported because the 1990 set is - based on the largest and most diverse set of empirical data. + based on the largest and most diverse set of empirical data References ---------- @@ -1553,16 +1553,16 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, solar_azimuth : numeric Solar azimuth angle. [°] poa_global : numeric - Plane-of-array global irradiance, aka global tilted irradiance [Wm⁻²]. + Plane-of-array global irradiance, aka global tilted irradiance. [Wm⁻²] dni_extra : numeric, optional - Extraterrestrial direct normal irradiance [Wm⁻²]. + Extraterrestrial direct normal irradiance. [Wm⁻²] airmass : numeric, optional - Relative airmass (not adjusted for pressure) [unitless]. + Relative airmass (not adjusted for pressure). [unitless] albedo : numeric, default 0.25 - Ground surface albedo [unitless]. + 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 [Wm⁻²]. + 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). @@ -1570,7 +1570,7 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, Returns ------- ghi : numeric - Estimated GHI [Wm⁻²]. + Estimated GHI. [Wm⁻²] converged : boolean, optional Present if full_output=True. Indicates which elements converged successfully. @@ -1629,14 +1629,14 @@ def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): Parameters ---------- ghi : numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] clearsky_ghi : numeric Modeled clearsky GHI max_clearsky_index : numeric, default 2.0 Maximum value of the clearsky index. The default, 2.0, allows - for over-irradiance events typically seen in sub-hourly data. + for over-irradiance events typically seen in sub-hourly data Returns ------- @@ -1672,7 +1672,7 @@ def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, Parameters ---------- ghi : numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric True (not refraction-corrected) solar zenith angle in decimal @@ -1687,8 +1687,8 @@ def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, max_clearness_index : numeric, default 2.0 Maximum value of the clearness index. The default, 2.0, allows - for over-irradiance events typically seen in sub-hourly data. - NREL's SRRL Fortran code used 0.82 for hourly data. + for over-irradiance events typically seen in sub-hourly data + NREL's SRRL Fortran code used 0.82 for hourly data Returns ------- @@ -1732,8 +1732,8 @@ def clearness_index_zenith_independent(clearness_index, airmass, max_clearness_index : numeric, default 2.0 Maximum value of the clearness index. The default, 2.0, allows - for over-irradiance events typically seen in sub-hourly data. - NREL's SRRL Fortran code used 0.82 for hourly data. + for over-irradiance events typically seen in sub-hourly data + NREL's SRRL Fortran code used 0.82 for hourly data Returns ------- @@ -1785,7 +1785,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Parameters ---------- ghi : numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric True (not refraction-corrected) solar zenith angles in decimal @@ -1931,7 +1931,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, Parameters ---------- ghi : array-like - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] solar_zenith : array-like True (not refraction-corrected) solar_zenith angles in decimal @@ -2173,13 +2173,13 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Parameters ---------- ghi : array-like - Global horizontal irradiance [Wm⁻²]. + 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 @@ -2218,7 +2218,7 @@ def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., Returns ------- dni : array-like - The modeled direct normal irradiance [Wm⁻²]. + The modeled direct normal irradiance. [Wm⁻²] Notes ----- @@ -2270,7 +2270,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, Parameters ---------- poa_global : array-like - Plane of array global irradiance [Wm⁻²]. + Plane of array global irradiance. [Wm⁻²] aoi : array-like Angle of incidence of solar rays with respect to the module @@ -2284,7 +2284,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, Solar azimuth angles in decimal degrees. times : DatetimeIndex - Time indices for the input array-like data. + Time indices for the input array-like data surface_tilt : numeric Surface tilt angles in decimal degrees. Tilt must be >=0 and @@ -2316,7 +2316,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, applied. albedo : numeric, default 0.25 - Ground surface albedo [unitless]. + Ground surface albedo. [unitless] model : String, default 'perez' Irradiance model. See :py:func:`get_sky_diffuse` for allowed values. @@ -2337,8 +2337,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 [Wm⁻²]. - * ``dni``: the modeled direct normal irradiance [Wm⁻²]. + * ``ghi``: the modeled global horizontal irradiance. [Wm⁻²] + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². @@ -2569,7 +2569,7 @@ def _gti_dirint_gte_90_kt_prime(aoi, solar_zenith, solar_azimuth, times, kt_prime_am_avg = data[aoi_65_80_morning].mean() kt_prime_pm_avg = data[aoi_65_80_afternoon].mean() - kt_prime_by_date = pd.Series(np.nan, index=data.index) + kt_prime_by_date = pd.Series(np.nan, index=dataindex) kt_prime_by_date[zenith_lt_90_aoi_gte_90_morning] = kt_prime_am_avg kt_prime_by_date[zenith_lt_90_aoi_gte_90_afternoon] = kt_prime_pm_avg kt_prime_gte_90.append(kt_prime_by_date) @@ -2602,7 +2602,7 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): Parameters ---------- ghi: numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex @@ -2620,7 +2620,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 [Wm⁻²]. + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2700,7 +2700,7 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance [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 @@ -2723,7 +2723,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 [Wm⁻²]. + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2821,14 +2821,14 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : int, float, array, pd.DatetimeIndex Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. dni_extra : numeric, optional - Extraterrestrial direct normal irradiance [Wm⁻²]. + Extraterrestrial direct normal irradiance. [Wm⁻²] min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global clearness index `kt`. Equivalent to zenith = 86.273 degrees. @@ -2841,7 +2841,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 [Wm⁻²]. + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -2914,7 +2914,7 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, Parameters ---------- ghi: numeric - Global horizontal irradiance [Wm⁻²]. + Global horizontal irradiance. [Wm⁻²] solar_zenith: numeric True (not refraction-corrected) zenith angles in decimal degrees. datetime_or_doy : numeric, pandas.DatetimeIndex @@ -2936,7 +2936,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 [Wm⁻²]. + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] * ``dhi``: the modeled diffuse horizontal irradiance in Wm⁻². * ``kt``: Ratio of global to extraterrestrial irradiance @@ -3708,7 +3708,7 @@ def complete_irradiance(solar_zenith, Parameters ---------- solar_zenith : series - Solar zenith angle [°], with datetime index. + Solar zenith angle. [°], with datetime index. Angles must be >=0 and <=180. Must have the same datetime index as ghi, dhi, and dni series, when available. See :term:`solar_zenith`. ghi : Series, optional @@ -3724,7 +3724,7 @@ def complete_irradiance(solar_zenith, same datetime index as ghi, dhi, and zenith series, when available. See :term:`dni`. dni_clear : Series, optional - Pandas series of clearsky dni data [Wm⁻²]. Must have the same datetime + Pandas series of clearsky dni data [Wm⁻²] Must have the same datetime index as ghi, dhi, dni, and zenith series, when available. See :py:func:`dni` for details. See :term:`dni_clear` for glossary definition. @@ -3735,7 +3735,7 @@ def complete_irradiance(solar_zenith, poa_global : numeric Plane-of-array global irradiance, aka global tilted irradiance . dni_extra : numeric, optional - Extraterrestrial direct normal irradiance [Wm⁻²]. + Extraterrestrial direct normal irradiance. [Wm⁻²] Returns ------- component_sum_df : Dataframe @@ -3769,10 +3769,10 @@ def louche(ghi, solar_zenith, datetime_or_doy, max_zenith=90): Parameters ---------- ghi : numeric - Global horizontal irradiance [Wm⁻²]. See :term:`ghi`. + Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. solar_zenith : numeric - True (not refraction-corrected) zenith angles [°]. + True (not refraction-corrected) zenith angles. [°] Angles must be >=0° and <=90°. See :term:`solar_zenith`. datetime_or_doy : numeric, pandas.DatetimeIndex @@ -3784,8 +3784,8 @@ 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 [Wm⁻²]. See :term:`dni` - * ``dhi``: the modeled diffuse horizontal irradiance [Wm⁻²]. + * ``dni``: the modeled direct normal irradiance. [Wm⁻²] See :term:`dni` + * ``dhi``: the modeled diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi` * ``kt``: Clearness index [unitless], ratio of global to extraterrestrial irradiance on a horizontal plane. @@ -3838,17 +3838,17 @@ def diffuse_par_spitters(daily_solar_zenith, global_diffuse_fraction): Parameters ---------- daily_solar_zenith : numeric - Average daily solar zenith angle [°]. + Average daily solar zenith angle. [°] global_diffuse_fraction : numeric Fraction of daily global broadband insolation that is diffuse. - Unitless [0, 1]. + Unitless [0, 1] Returns ------- par_diffuse_fraction : numeric Fraction of daily photosynthetically active radiation (PAR) that is - diffuse. Unitless [0, 1]. + diffuse. Unitless [0, 1] Notes ----- From 2d219a342c0421fff2ce78c48981d94c0bd6a0fc Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:55:04 -0700 Subject: [PATCH 05/15] Update pvlib/irradiance.py Co-authored-by: Adam R. Jensen <39184289+AdamRJensen@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 4a20aee25c..9b167644d5 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -58,8 +58,8 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Returns ------- dni_extra : float, array, or Series - The extraterrestrial radiation present in watts per square meter - on a surface which is normal to the sun. Pandas Timestamp and + The extraterrestrial radiation normal to the sun. [Wm⁻²] + Pandas Timestamp and DatetimeIndex inputs will yield a Pandas TimeSeries. All other inputs will yield a float or an array of floats. See :term:`dni_extra`. From 7c6bb5da8d4e5fe09957be29e79449575fd0b0db Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 3 Jan 2025 11:01:18 -0700 Subject: [PATCH 06/15] =?UTF-8?q?in=20decimal=20degrees=20->=20[=C2=B0]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pvlib/irradiance.py | 50 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 52cc65cf4f..d1a105aab4 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): Parameters ---------- surface_tilt : numeric - Surface tilt angles in decimal degrees. Tilt must be >=0 and + Surface tilt angles. [°] Tilt must be >=0 and <=180. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90). @@ -640,12 +640,12 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, Parameters ---------- surface_tilt : numeric - Surface tilt angles in decimal degrees. ``surface_tilt`` must be >=0 + Surface tilt angles. [°] ``surface_tilt`` must be >=0 and <=180. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) surface_azimuth : numeric - Surface azimuth angles in decimal degrees. ``surface_azimuth`` must + Surface azimuth angles. [°] ``surface_azimuth`` must be >=0 and <=360. The Azimuth convention is defined as degrees east of north (e.g. North = 0, South=180 East = 90, West = 270). @@ -660,7 +660,7 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, degrees. ``solar_zenith`` must be >=0 and <=180. solar_azimuth : numeric - Sun azimuth angles in decimal degrees. ``solar_azimuth`` must be >=0 + Sun azimuth angles. [°] ``solar_azimuth`` must be >=0 and <=360. The Azimuth convention is defined as degrees east of north (e.g. North = 0, East = 90, West = 270). @@ -749,7 +749,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, :term:`surface_tilt`. surface_azimuth : numeric - Surface azimuth angles in decimal degrees. The azimuth + Surface azimuth angles. [°] The azimuth convention is defined as degrees east of north (e.g. North=0, South=180, East=90, West=270). @@ -768,7 +768,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, supply ``projection_ratio``. solar_azimuth : numeric, optional - Solar azimuth angles in decimal degrees. Must supply + Solar azimuth angles. [°] Must supply ``solar_zenith`` and ``solar_azimuth`` or supply ``projection_ratio``. @@ -887,12 +887,12 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Parameters ---------- surface_tilt : numeric - Surface tilt angles in decimal degrees. The tilt angle is + Surface tilt angles. [°] The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) surface_azimuth : numeric - Surface azimuth angles in decimal degrees. The azimuth + Surface azimuth angles. [°] The azimuth convention is defined as degrees east of north (e.g. North = 0, South=180 East = 90, West = 270). @@ -909,10 +909,10 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric - Apparent (refraction-corrected) zenith angles in decimal degrees. + Apparent (refraction-corrected) zenith angles. [°] solar_azimuth : numeric - Sun azimuth angles in decimal degrees. The azimuth convention is + Sun azimuth angles. [°] The azimuth convention is defined as degrees east of north (e.g. North = 0, East = 90, West = 270). @@ -1004,7 +1004,7 @@ def king(surface_tilt, dhi, ghi, solar_zenith): Parameters ---------- surface_tilt : numeric - Surface tilt angles in decimal degrees. The tilt angle is + Surface tilt angles. [°] The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) @@ -1015,7 +1015,7 @@ def king(surface_tilt, dhi, ghi, solar_zenith): Global horizontal irradiance. [Wm⁻²] solar_zenith : numeric - Apparent (refraction-corrected) zenith angles in decimal degrees. + Apparent (refraction-corrected) zenith angles. [°] Returns -------- @@ -1056,12 +1056,12 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Parameters ---------- surface_tilt : numeric - Surface tilt angles in decimal degrees. surface_tilt must be >=0 + Surface tilt angles. [°] surface_tilt must be >=0 and <=180. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) surface_azimuth : numeric - Surface azimuth angles in decimal degrees. surface_azimuth must + Surface azimuth angles. [°] surface_azimuth must be >=0 and <=360. The azimuth convention is defined as degrees east of north (e.g. North = 0, South=180 East = 90, West = 270). @@ -1079,7 +1079,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, degrees. solar_zenith must be >=0 and <=180. solar_azimuth : numeric - Sun azimuth angles in decimal degrees. solar_azimuth must be >=0 + Sun azimuth angles. [°] solar_azimuth must be >=0 and <=360. The azimuth convention is defined as degrees east of north (e.g. North = 0, East = 90, West = 270). @@ -1322,12 +1322,12 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Parameters ---------- surface_tilt : numeric - Surface tilt angles in decimal degrees. surface_tilt must be >=0 + Surface tilt angles. [°] surface_tilt must be >=0 and <=180. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90) surface_azimuth : numeric - Surface azimuth angles in decimal degrees. surface_azimuth must + Surface azimuth angles. [°] surface_azimuth must be >=0 and <=360. The azimuth convention is defined as degrees east of north (e.g. North = 0, South=180 East = 90, West = 270). @@ -1345,7 +1345,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, degrees. solar_zenith must be >=0 and <=180. solar_azimuth : numeric - Sun azimuth angles in decimal degrees. solar_azimuth must be >=0 + Sun azimuth angles. [°] solar_azimuth must be >=0 and <=360. The azimuth convention is defined as degrees east of north (e.g. North = 0, East = 90, West = 270). @@ -2305,18 +2305,18 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, degrees. solar_azimuth : array-like - Solar azimuth angles in decimal degrees. + Solar azimuth angles. [°] times : DatetimeIndex Time indices for the input array-like data surface_tilt : numeric - Surface tilt angles in decimal degrees. Tilt must be >=0 and + Surface tilt angles. [°] Tilt must be >=0 and <=180. The tilt angle is defined as degrees from horizontal (e.g. surface facing up = 0, surface facing horizon = 90). surface_azimuth : numeric - Surface azimuth angles in decimal degrees. surface_azimuth must + Surface azimuth angles. [°] surface_azimuth must be >=0 and <=360. The Azimuth convention is defined as degrees east of north (e.g. North = 0, South=180 East = 90, West = 270). @@ -2628,7 +2628,7 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): ghi: numeric Global horizontal irradiance. [Wm⁻²] zenith: numeric - True (not refraction-corrected) zenith angles in decimal degrees. + True (not refraction-corrected) zenith angles. [°] datetime_or_doy : int, float, array, pd.DatetimeIndex Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. @@ -2726,7 +2726,7 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, ghi: numeric Global horizontal irradiance. [Wm⁻²] zenith: numeric - True (not refraction-corrected) zenith angles in decimal degrees. + True (not refraction-corrected) zenith angles. [°] datetime_or_doy : int, float, array or pd.DatetimeIndex, optional Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. @@ -2847,7 +2847,7 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, ghi: numeric Global horizontal irradiance. [Wm⁻²] zenith: numeric - True (not refraction-corrected) zenith angles in decimal degrees. + True (not refraction-corrected) zenith angles. [°] datetime_or_doy : int, float, array, pd.DatetimeIndex Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. @@ -2940,7 +2940,7 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, ghi: numeric Global horizontal irradiance. [Wm⁻²] solar_zenith: numeric - True (not refraction-corrected) zenith angles in decimal degrees. + True (not refraction-corrected) zenith angles. [°] datetime_or_doy : numeric, pandas.DatetimeIndex Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. From 94ea3ab21c3376bab7eb5512b1017fc637210673 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 3 Jan 2025 11:02:55 -0700 Subject: [PATCH 07/15] reinsert . --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index d1a105aab4..ee36305e0f 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -2593,7 +2593,7 @@ def _gti_dirint_gte_90_kt_prime(aoi, solar_zenith, solar_azimuth, times, kt_prime_am_avg = data[aoi_65_80_morning].mean() kt_prime_pm_avg = data[aoi_65_80_afternoon].mean() - kt_prime_by_date = pd.Series(np.nan, index=dataindex) + kt_prime_by_date = pd.Series(np.nan, index=data.index) kt_prime_by_date[zenith_lt_90_aoi_gte_90_morning] = kt_prime_am_avg kt_prime_by_date[zenith_lt_90_aoi_gte_90_afternoon] = kt_prime_pm_avg kt_prime_gte_90.append(kt_prime_by_date) From 7e13249620e85da12094153b277ef7aa42f9cb28 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 3 Jan 2025 20:02:30 -0700 Subject: [PATCH 08/15] Update irradiance.py --- pvlib/irradiance.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index ee36305e0f..48874ce32f 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -534,7 +534,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. [Wm⁻²] + Global horizontal irradiance. [Wm⁻²] albedo : numeric, default 0.25 Ground reflectance, typically 0.1-0.4 for surfaces on Earth @@ -602,12 +602,13 @@ def isotropic(surface_tilt, dhi): Parameters ---------- surface_tilt : numeric - Surface tilt angle in decimal degrees. Tilt must be >=0 and + Surface tilt angle. [°] Tilt must be >=0 and <=180. The tilt angle is defined as degrees from horizontal - (e.g. surface facing up = 0, surface facing horizon = 90) + (e.g. surface facing up = 0, surface facing horizon = 90). + See :term:`surface_tilt`. dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. + Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. See :term:`dhi`. Returns ------- @@ -656,8 +657,8 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, Global horizontal irradiance, must be >=0. [Wm⁻²] solar_zenith : numeric - Apparent (refraction-corrected) zenith angles in decimal - degrees. ``solar_zenith`` must be >=0 and <=180. + Apparent (refraction-corrected) zenith angles. [°] + ``solar_zenith`` must be >=0 and <=180. See :term:`solar_zenith`. solar_azimuth : numeric Sun azimuth angles. [°] ``solar_azimuth`` must be >=0 @@ -745,22 +746,21 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Parameters ---------- surface_tilt : numeric - Panel tilt from the horizontal, in decimal degrees, see - :term:`surface_tilt`. + Panel tilt from the horizontal. [°] See :term:`surface_tilt`. surface_azimuth : numeric Surface azimuth angles. [°] The azimuth convention is defined as degrees east of north (e.g. North=0, - South=180, East=90, West=270). + South=180, East=90, West=270). See :term:`surface_azimuth`. dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] + Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. dni : numeric Direct normal irradiance, see :term:`dni`. [Wm⁻²] dni_extra : numeric - Extraterrestrial normal irradiance. [Wm⁻²] + Extraterrestrial normal irradiance, see :term:`dni_extra`. [Wm⁻²] solar_zenith : numeric, optional Solar apparent (refraction-corrected) zenith angles in decimal @@ -3660,17 +3660,17 @@ def dni(ghi, dhi, zenith, dni_clear=None, clearsky_tolerance=1.1, Parameters ---------- ghi : Series - Global horizontal irradiance. + Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. dhi : Series - Diffuse horizontal irradiance. + Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. zenith : Series True (not refraction-corrected) zenith angles in decimal degrees. Angles must be >=0 and <=180. dni_clear : Series, optional - Clearsky direct normal irradiance. [Wm⁻²] + Clearsky direct normal irradiance. [Wm⁻²] See :term:`dni_clear`. .. versionchanged:: 0.11.2 Renamed from ``clearsky_dni`` to ``dni_clear``. From 3c651e747242bd33ed5c473e5eb7d641cb661a09 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 3 Jan 2025 20:06:50 -0700 Subject: [PATCH 09/15] linter --- pvlib/irradiance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 48874ce32f..8ee784815d 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -534,7 +534,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. [Wm⁻²] + Global horizontal irradiance. [Wm⁻²] albedo : numeric, default 0.25 Ground reflectance, typically 0.1-0.4 for surfaces on Earth From ef26630e525e76fb57adf37f78770a512f6298ff Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 25 Apr 2025 14:49:40 -0600 Subject: [PATCH 10/15] Update irradiance.py --- pvlib/irradiance.py | 605 +++++++++++++++++++++++--------------------- 1 file changed, 317 insertions(+), 288 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 9e12ac3dfb..747db08cf2 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -63,10 +63,10 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Returns ------- dni_extra : float, array, or Series - The extraterrestrial radiation normal to the sun. [Wm⁻²] - Pandas Timestamp and - DatetimeIndex inputs will yield a Pandas TimeSeries. All other - inputs will yield a float or an array of floats. See :term:`dni_extra`. + The extraterrestrial radiation normal to the sun. + Pandas Timestamp and DatetimeIndex inputs will yield a Pandas + TimeSeries. All other inputs will yield a float or an array of floats. + See :term:`dni_extra`. [Wm⁻²] References ---------- @@ -171,13 +171,16 @@ def aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth): Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [°] See :term:`surface_tilt`. + Panel tilt from horizontal. See :term:`surface_tilt`. [°] + surface_azimuth : numeric - Panel azimuth from north. [°] See :term:`surface_azimuth`. + Panel azimuth from north. See :term:`surface_azimuth`. [°] + solar_zenith : numeric - Solar zenith angle. See :term:`solar_zenith`. + Solar zenith angle. See :term:`solar_zenith`. [°] + solar_azimuth : numeric - Solar azimuth angle. See :term:`solar_azimuth`. + Solar azimuth angle. See :term:`solar_azimuth`. [°] Returns ------- @@ -212,18 +215,18 @@ def aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth): Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [°] See :term:`surface_tilt`. + Panel tilt from horizontal. See :term:`surface_tilt`. [°] surface_azimuth : numeric - Panel azimuth from north. [°] See :term:`surface_azimuth`. + Panel azimuth from north. See :term:`surface_azimuth`. [°] solar_zenith : numeric - Solar zenith angle. [°] See :term:`solar_zenith`. + Solar zenith angle. See :term:`solar_zenith`. [°] solar_azimuth : numeric - Solar azimuth angle. [°] See :term:`solar_azimuth`. + Solar azimuth angle. See :term:`solar_azimuth`. [°] Returns ------- aoi : numeric - Angle of incidence. [°] See :term:`aoi`. + Angle of incidence, see :term:`aoi`. [°] """ projection = aoi_projection(surface_tilt, surface_azimuth, @@ -246,15 +249,15 @@ def beam_component(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [°] See :term:`surface_tilt`. + Panel tilt from horizontal. See :term:`surface_tilt`. [°] surface_azimuth : numeric - Panel azimuth from north. [°] See :term:`surface_azimuth`. + Panel azimuth from north. See :term:`surface_azimuth`. [°] solar_zenith : numeric - Solar zenith angle. [°] See :term:`solar_zenith`. + Solar zenith angle. See :term:`solar_zenith`. [°] solar_azimuth : numeric - Solar azimuth angle. [°] See :term:`solar_azimuth`. + Solar azimuth angle. See :term:`solar_azimuth`. [°] dni : numeric - Direct normal irradiance. [Wm⁻²] See :term:`dni`. + Direct normal irradiance, see :term:`dni`. [Wm⁻²] Returns ------- @@ -294,27 +297,27 @@ def get_total_irradiance(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [°] See :term:`surface_tilt`. + Panel tilt from horizontal. See :term:`surface_tilt`. [°] surface_azimuth : numeric - Panel azimuth from north. [°] See :term:`surface_azimuth`. + Panel azimuth from north. See :term:`surface_azimuth`. [°] solar_zenith : numeric - Solar zenith angle. [°] See :term:`solar_zenith`. + Solar zenith angle. See :term:`solar_zenith`. [°] solar_azimuth : numeric - Solar azimuth angle. [°] See :term:`solar_azimuth`. + Solar azimuth angle. See :term:`solar_azimuth`. [°] dni : numeric - Direct normal irradiance. [Wm⁻²] See :term:`dni`. + Direct normal irradiance. See :term:`dni`. [Wm⁻²] ghi : numeric - Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. + Diffuse horizontal irradiance. See :term:`dhi`. [Wm⁻²] dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] - See :term:`dni_extra`. + Extraterrestrial direct normal irradiance. See :term:`dni_extra`. + [Wm⁻²] airmass : numeric, optional - Relative airmass (not adjusted for pressure). [unitless] - See :term:`airmass`. + Relative airmass, not adjusted for pressure. + See :term:`airmass_relative`. [unitless] albedo : numeric, default 0.25 - Ground surface albedo. [unitless] See :term:`albedo`. + Ground surface albedo. See :term:`albedo`. [unitless] surface_type : str, optional Surface type. See :py:func:`~pvlib.irradiance.get_ground_diffuse` for the list of accepted values. @@ -329,7 +332,7 @@ def get_total_irradiance(surface_tilt, surface_azimuth, ------- total_irrad : OrderedDict or DataFrame Contains keys/columns ``'poa_global', 'poa_direct', 'poa_diffuse', - 'poa_sky_diffuse', 'poa_ground_diffuse'``. + 'poa_sky_diffuse', 'poa_ground_diffuse'``. [Wm⁻²] Notes ----- @@ -375,25 +378,25 @@ def get_sky_diffuse(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [°] See :term:`surface_tilt`. + Panel tilt from horizontal. See :term:`surface_tilt`. [°] surface_azimuth : numeric - Panel azimuth from north. [°] See :term:`surface_azimuth`. + Panel azimuth from north. See :term:`surface_azimuth`. [°] solar_zenith : numeric - Solar zenith angle. [°] See :term:`solar_zenith`. + Solar zenith angle. See :term:`solar_zenith`. [°] solar_azimuth : numeric - Solar azimuth angle. [°] See :term:`solar_azimuth`. + Solar azimuth angle. See :term:`solar_azimuth`. [°] dni : numeric - Direct normal irradiance. [Wm⁻²] See :term:`dni`. + Direct normal irradiance. See :term:`dni`. [Wm⁻²] ghi : numeric - Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. + Diffuse horizontal irradiance. See :term:`dhi`. [Wm⁻²] dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] - See :term:`dni_extra`. + Extraterrestrial direct normal irradiance. See :term:`dni_extra`. + [Wm⁻²] airmass : numeric, optional - Relative airmass (not adjusted for pressure). [unitless] - See :term:`airmass`. + Relative airmass, not adjusted for pressure. + See :term:`airmass_relative`. [unitless] model : str, default 'isotropic' Irradiance model. Can be one of ``'isotropic'``, ``'klucher'``, ``'haydavies'``, ``'reindl'``, ``'king'``, ``'perez'``, @@ -474,19 +477,19 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): ---------- aoi : numeric Angle of incidence of solar rays with respect to the module - surface, from :func:`aoi`. [°] See :term:`aoi`. + surface, from :func:`aoi`. See :term:`aoi`. [°] dni : numeric - Direct normal irradiance. [Wm⁻²], as measured from a TMY file or - calculated with a clearsky model. See :term:`dni`. + Direct normal irradiance, as measured from a TMY file or + calculated with a clearsky model. See :term:`dni`. [Wm⁻²] poa_sky_diffuse : numeric - Diffuse irradiance [Wm⁻²] in the plane of the modules, as - calculated by a diffuse irradiance translation function. + Diffuse irradiance in the plane of the modules, as + calculated by a diffuse irradiance translation function. [Wm⁻²] poa_ground_diffuse : numeric - Ground reflected irradiance [Wm⁻²] in the plane of the modules, - as calculated by an albedo model (eg. :func:`grounddiffuse`) + Ground reflected irradiance in the plane of the modules, + as calculated by an albedo model (eg. :func:`grounddiffuse`). [Wm⁻²] Returns ------- @@ -502,8 +505,7 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): Notes ------ - Negative beam irradiation due to aoi :math:`> 90^{\circ}` or AOI - :math:`< 0^{\circ}` is set to zero. + Negative beam irradiation due to AOI > 90° or AOI < 0° is set to zero. ''' poa_direct = np.maximum(dni * np.cos(np.radians(aoi)), 0) @@ -538,18 +540,17 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): Parameters ---------- surface_tilt : numeric - Surface tilt angles. [°] Tilt must be >=0 and - <=180. The tilt angle is defined as degrees from horizontal - (e.g. surface facing up = 0, surface facing horizon = 90). + Panel tilt from horizontal. See :term:`surface_tilt`. [°] ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] albedo : numeric, default 0.25 - Ground reflectance, typically 0.1-0.4 for surfaces on Earth + Ground surface albedo., typically 0.1-0.4 for surfaces on Earth (land), may increase over snow, ice, etc. May also be known as the reflection coefficient. Must be >=0 and <=1. Will be - overridden if ``surface_type`` is supplied. + overridden if ``surface_type`` is supplied. See :term:`albedo`. + [unitless] surface_type : string, optional If supplied, overrides ``albedo``. ``surface_type`` can be one of @@ -611,18 +612,15 @@ def isotropic(surface_tilt, dhi): Parameters ---------- surface_tilt : numeric - Surface tilt angle. [°] Tilt must be >=0 and - <=180. The tilt angle is defined as degrees from horizontal - (e.g. surface facing up = 0, surface facing horizon = 90). - See :term:`surface_tilt`. + Panel tilt from horizontal. See :term:`surface_tilt`. [°] dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. See :term:`dhi`. + Diffuse horizontal irradiance, must be >=0. See :term:`dhi`. Returns ------- diffuse : numeric - The sky diffuse component of the solar radiation. + The sky diffuse component of the solar radiation. [Wm⁻²] References ---------- @@ -650,29 +648,24 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, Parameters ---------- surface_tilt : numeric - Surface tilt angles. [°] ``surface_tilt`` must be >=0 - and <=180. The tilt angle is defined as degrees from horizontal - (e.g. surface facing up = 0, surface facing horizon = 90) + Panel tilt from horizontal. See :term:`surface_tilt`. [°] surface_azimuth : numeric - Surface azimuth angles. [°] ``surface_azimuth`` must - be >=0 and <=360. The Azimuth convention is defined as degrees - east of north (e.g. North = 0, South=180 East = 90, West = 270). + Panel azimuth from north. See :term:`surface_azimuth`. [°] dhi : numeric - Diffuse horizontal irradiance, must be >=0. [Wm⁻²] + Diffuse horizontal irradiance, must be >=0. See :term:`dhi`. [Wm⁻²] ghi : numeric - Global horizontal irradiance, must be >=0. [Wm⁻²] + Global horizontal irradiance, must be >=0. See :term:`ghi`. [Wm⁻²] solar_zenith : numeric - Apparent (refraction-corrected) zenith angles. [°] - ``solar_zenith`` must be >=0 and <=180. See :term:`solar_zenith`. + Apparent (refraction-corrected) zenith angles. + ``solar_zenith`` must be >=0° and <=180. See :term:`solar_zenith`. [°] solar_azimuth : numeric - Sun azimuth angles. [°] ``solar_azimuth`` must be >=0 - and <=360. The Azimuth convention is defined as degrees east of - north (e.g. North = 0, East = 90, West = 270). + Sun azimuth angles. ``solar_azimuth`` must be >=0° and <=360. See + :term:`solar_azimuth`. [°] Returns ------- @@ -755,12 +748,10 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Parameters ---------- surface_tilt : numeric - Panel tilt from the horizontal. [°] See :term:`surface_tilt`. + Panel tilt from the horizontal. See :term:`surface_tilt`. [°] surface_azimuth : numeric - Surface azimuth angles. [°] The azimuth - convention is defined as degrees east of north (e.g. North=0, - South=180, East=90, West=270). See :term:`surface_azimuth`. + Panel azimuth from north. See :term:`surface_azimuth`. [°] dhi : numeric Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. @@ -772,14 +763,14 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Extraterrestrial normal irradiance, see :term:`dni_extra`. [Wm⁻²] solar_zenith : numeric, optional - Solar apparent (refraction-corrected) zenith angles in decimal - degrees. Must supply ``solar_zenith`` and ``solar_azimuth`` or - supply ``projection_ratio``. + Solar apparent (refraction-corrected) zenith angles. Must supply + ``solar_zenith`` and ``solar_azimuth``, or supply ``projection_ratio``. + See :term:`solar_zenith`. [°] solar_azimuth : numeric, optional - Solar azimuth angles. [°] Must supply - ``solar_zenith`` and ``solar_azimuth`` or supply - ``projection_ratio``. + Solar azimuth angles. Must supply ``solar_zenith`` and + ``solar_azimuth``, or supply ``projection_ratio``. See + :term:`solar_azimuth`. [°] projection_ratio : numeric, optional Ratio of angle of incidence projection to solar zenith angle @@ -799,7 +790,7 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, sky_diffuse : numeric The sky diffuse component of the solar radiation on a tilted - surface. + surface. [Wm⁻²] diffuse_components : OrderedDict (array input) or DataFrame (Series input) Keys/columns are: @@ -896,39 +887,32 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Parameters ---------- surface_tilt : numeric - Surface tilt angles. [°] The tilt angle is - defined as degrees from horizontal (e.g. surface facing up = 0, - surface facing horizon = 90) + Panel tilt from the horizontal. See :term:`surface_tilt`. [°] surface_azimuth : numeric - Surface azimuth angles. [°] The azimuth - convention is defined as degrees east of north (e.g. North = 0, - South=180 East = 90, West = 270). + Panel azimuth from north. See :term:`surface_azimuth`. [°] dhi : numeric - diffuse horizontal irradiance. [Wm⁻²] + Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. dni : numeric - direct normal irradiance. [Wm⁻²] - - ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Direct normal irradiance, see :term:`dni`. [Wm⁻²] dni_extra : numeric - Extraterrestrial normal irradiance. [Wm⁻²] + Extraterrestrial normal irradiance, see :term:`dni_extra`. [Wm⁻²] - solar_zenith : numeric - Apparent (refraction-corrected) zenith angles. [°] + solar_zenith : numeric, optional + Solar apparent (refraction-corrected) zenith angles. Must supply + ``solar_zenith`` and ``solar_azimuth``, or supply ``projection_ratio``. + See :term:`solar_zenith`. [°] - solar_azimuth : numeric - Sun azimuth angles. [°] The azimuth convention is - defined as degrees east of north (e.g. North = 0, East = 90, - West = 270). + solar_azimuth : numeric, optional + Solar azimuth angles. See :term:`solar_azimuth`. [°] Returns ------- poa_sky_diffuse : numeric - The sky diffuse component of the solar radiation. + The sky diffuse component of the solar radiation. [Wm⁻²] Notes ----- @@ -1012,19 +996,18 @@ def king(surface_tilt, dhi, ghi, solar_zenith): Parameters ---------- - surface_tilt : numeric - Surface tilt angles. [°] The tilt angle is - defined as degrees from horizontal (e.g. surface facing up = 0, - surface facing horizon = 90) + surface_tilt : numeric + Panel tilt from the horizontal. See :term:`surface_tilt`. [°] - dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] + dhi : numeric + Diffuse horizontal irradiance. See :term:`dhi`. [Wm⁻²] ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] - solar_zenith : numeric - Apparent (refraction-corrected) zenith angles. [°] + solar_zenith : numeric, optional + Solar apparent (refraction-corrected) zenith angles. + See :term:`solar_zenith`. [°] Returns -------- @@ -1065,38 +1048,36 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Parameters ---------- surface_tilt : numeric - Surface tilt angles. [°] surface_tilt must be >=0 - and <=180. The tilt angle is defined as degrees from horizontal - (e.g. surface facing up = 0, surface facing horizon = 90) + Surface tilt angle, must be >=0° and <=180°. See :term:`surface_tilt`. + [°] surface_azimuth : numeric - Surface azimuth angles. [°] surface_azimuth must - be >=0 and <=360. The azimuth convention is defined as degrees - east of north (e.g. North = 0, South=180 East = 90, West = 270). + Surface azimuth angle, must be >=0° and <=360°. + See :term:`surface_azimuth`. [°] dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] DHI must be >=0. + Diffuse horizontal irradiancm, must be >=0. [Wm⁻²] dni : numeric - Direct normal irradiance. [Wm⁻²] DNI must be >=0. + Direct normal irradiancm, must be >=0. [Wm⁻²] + dni_extra : numeric Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric - apparent (refraction-corrected) zenith angles in decimal - degrees. solar_zenith must be >=0 and <=180. + apparent (refraction-corrected) zenith angle, must be >=0° and <=180°. + [°] solar_azimuth : numeric - Sun azimuth angles. [°] solar_azimuth must be >=0 - and <=360. The azimuth convention is defined as degrees east of - north (e.g. North = 0, East = 90, West = 270). + Solar azimuth angle, must be >=0° and <=360°. + See :term:`solar_azimuth`. [°] airmass : numeric Relative (not pressure-corrected) airmass values. If AM is a DataFrame it must be of the same size as all other DataFrame inputs. AM must be >=0 (careful using the 1/sec(z) model of AM - generation) + generation). [unitless] model : string, default 'allsitescomposite1990' A string which selects the desired set of Perez coefficients. If @@ -1331,39 +1312,36 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Parameters ---------- surface_tilt : numeric - Surface tilt angles. [°] surface_tilt must be >=0 - and <=180. The tilt angle is defined as degrees from horizontal - (e.g. surface facing up = 0, surface facing horizon = 90) + Surface tilt angle, must be >=0° and <=180°. See :term:`surface_tilt`. + [°] surface_azimuth : numeric - Surface azimuth angles. [°] surface_azimuth must - be >=0 and <=360. The azimuth convention is defined as degrees - east of north (e.g. North = 0, South=180 East = 90, West = 270). + Surface azimuth angle, must be >=0° and <=360°. + See :term:`surface_azimuth`. [°] dhi : numeric - Diffuse horizontal irradiance. [Wm⁻²] dhi must be >=0. + Diffuse horizontal irradiancm, must be >=0. [Wm⁻²] dni : numeric - Direct normal irradiance. [Wm⁻²] dni must be >=0. + Direct normal irradiancm, must be >=0. [Wm⁻²] + dni_extra : numeric Extraterrestrial normal irradiance. [Wm⁻²] solar_zenith : numeric - apparent (refraction-corrected) zenith angles in decimal - degrees. solar_zenith must be >=0 and <=180. + apparent (refraction-corrected) zenith angle, must be >=0° and <=180°. + [°] solar_azimuth : numeric - Sun azimuth angles. [°] solar_azimuth must be >=0 - and <=360. The azimuth convention is defined as degrees east of - north (e.g. North = 0, East = 90, West = 270). + Solar azimuth angle, must be >=0° and <=360°. + See :term:`solar_azimuth`. [°] - airmass : numeric, optional - Relative (not pressure-corrected) airmass values. If ``airmass`` is a + airmass : numeric + Relative (not pressure-corrected) airmass values. If AM is a DataFrame it must be of the same size as all other DataFrame - inputs. The kastenyoung1989 airmass calculation is used internally - and is also recommended when pre-calculating airmass because - it was used in the original model development. + inputs. AM must be >=0 (careful using the 1/sec(z) model of AM + generation). [unitless] return_components: bool (optional, default=False) Flag used to decide whether to return the calculated diffuse components @@ -1554,24 +1532,36 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, Parameters ---------- surface_tilt : numeric - Panel tilt from horizontal. [°] + Panel tilt from horizontal. See :term:`surface_tilt`. [°] + surface_azimuth : numeric - Panel azimuth from north. [°] + Panel azimuth from north. See :term:`surface_azimuth`. [°] + solar_zenith : numeric - Solar zenith angle. [°] + Solar zenith angle. See :term:`solar_zenith`. [°] + solar_azimuth : numeric - Solar azimuth angle. [°] + Solar azimuth angle. See :term:`solar_azimuth`. [°] + poa_global : numeric - Plane-of-array global irradiance, aka global tilted irradiance. [Wm⁻²] + Plane-of-array global irradiance, aka global tilted irradiance. + See :term:`poa_global`. [Wm⁻²] + dni_extra : numeric - Extraterrestrial direct normal irradiance. [Wm⁻²] + Extraterrestrial direct normal irradiance. See :Term:`dni_extra`. + [Wm⁻²] + airmass : numeric, optional - Relative airmass (not adjusted for pressure). [unitless] + Relative airmass (not adjusted for pressure). See + :term:`airmass_relative`. [unitless] + albedo : numeric, default 0.25 - Ground surface albedo. [unitless] + Ground surface albedo. See :term:`albedo`. [unitless] + xtol : numeric, default 0.01 Convergence criterion. The estimated GHI will be within xtol of the 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). @@ -1579,7 +1569,7 @@ def ghi_from_poa_driesse_2023(surface_tilt, surface_azimuth, Returns ------- ghi : numeric - Estimated GHI. [Wm⁻²] + Estimated global horizontal irradiance. See :term:`ghi`. [Wm⁻²] converged : boolean, optional Present if full_output=True. Indicates which elements converged successfully. @@ -1643,10 +1633,10 @@ def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] ghi_clear : numeric - Modeled clearsky GHI + Modeled clearsky GHI. See :term:`ghi_clear`. [Wm⁻²] .. versionchanged:: 0.11.2 Renamed from ``ghi_clearsky`` to ``ghi_clear``. @@ -1658,7 +1648,7 @@ def clearsky_index(ghi, ghi_clear, max_clearsky_index=2.0): Returns ------- clearsky_index : numeric - Clearsky index + Clearsky index. [unitless] """ clearsky_index = ghi / ghi_clear # set +inf, -inf, and nans to zero @@ -1689,28 +1679,29 @@ def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] solar_zenith : numeric - True (not refraction-corrected) solar zenith angle in decimal - degrees. + True (not refraction-corrected) solar zenith angle. + See :term:`solar_zenith`. [°] extra_radiation : numeric - Irradiance incident at the top of the atmosphere + Irradiance incident at the top of the atmosphere. See + :term:`dni_extra`. [Wm⁻²] min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global - clearness index `kt`. Equivalent to zenith = 86.273 degrees. + clearness index `kt`. Equivalent to zenith = 86.273°. max_clearness_index : numeric, default 2.0 Maximum value of the clearness index. The default, 2.0, allows for over-irradiance events typically seen in sub-hourly data - NREL's SRRL Fortran code used 0.82 for hourly data + NREL's SRRL Fortran code used 0.82 for hourly data. Returns ------- kt : numeric - Clearness index + Clearness index. [unitless] References ---------- @@ -1742,10 +1733,10 @@ def clearness_index_zenith_independent(clearness_index, airmass, ---------- clearness_index : numeric Ratio of global to extraterrestrial irradiance on a horizontal - plane + plane. [unitless] airmass : numeric - Airmass + Airmass. See :term:`relative_airmass`. [unitless] max_clearness_index : numeric, default 2.0 Maximum value of the clearness index. The default, 2.0, allows @@ -1755,7 +1746,7 @@ def clearness_index_zenith_independent(clearness_index, airmass, Returns ------- kt_prime : numeric - Zenith independent clearness index + Zenith-independent clearness index. [unitless] References ---------- @@ -1802,32 +1793,33 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] solar_zenith : numeric - True (not refraction-corrected) solar zenith angles in decimal - degrees. + True (not refraction-corrected) solar zenith angles. See + :term:`solar_zenith`. [°] datetime_or_doy : int, float, array, pd.DatetimeIndex Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. pressure : numeric or None, default 101325 - Site pressure in Pascal. Uses absolute (pressure-corrected) airmass - by default. Set to ``None`` to use relative airmass. + Site pressure. Uses absolute (pressure-corrected) airmass + by default. Set to ``None`` to use relative airmass. See + :term:`pressure`. [Pa] min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global - clearness index `kt`. Equivalent to zenith = 86.273 degrees. + clearness index `kt`. Equivalent to zenith = 86.273°. max_zenith : numeric, default 87 Maximum value of zenith to allow in DNI calculation. DNI will be - set to 0 for times with zenith values greater than `max_zenith`. + set to 0 for times with zenith values greater than `max_zenith`. [°] max_airmass : numeric, default 12 Maximum value of the airmass to allow in Kn calculation. Default value (12) comes from range over which Kn was fit - to airmass in the original paper. + to airmass in the original paper. [unitless] Returns ------- @@ -1835,11 +1827,11 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Contains the following keys: * ``dni``: The modeled direct normal irradiance - in Wm⁻² provided by the - Direct Insolation Simulation Code (DISC) model. + provided by the Direct Insolation Simulation Code (DISC) model. + [Wm⁻²] * ``kt``: Ratio of global to extraterrestrial - irradiance on a horizontal plane. - * ``airmass``: Airmass + irradiance on a horizontal plane. [unitless] + * ``airmass``: Airmass. [unitless] References ---------- @@ -1948,17 +1940,18 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, Parameters ---------- ghi : array-like - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] - solar_zenith : array-like - True (not refraction-corrected) solar_zenith angles in decimal - degrees. + solar_zenith : numeric + True (not refraction-corrected) solar zenith angles. See + :term:`solar_zenith`. [°] times : DatetimeIndex pressure : float or array-like, default 101325.0 - The site pressure in Pascal. Pressure may be measured or an - average pressure may be calculated from site altitude. + The site air pressure. Pressure may be measured or an + average pressure may be calculated from site altitude. See + :term:`pressure`. [Pa] use_delta_kt_prime : bool, default True If True, indicates that the stability index delta_kt_prime is @@ -1969,25 +1962,25 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, input data must be Series. temp_dew : float, or array-like, optional - Surface dew point temperatures, in degrees C. Values of temp_dew + Surface dew point temperatures, in. Values of ``temp_dew`` may be numeric or NaN. Any single time period point with a temp_dew=NaN does not have dew point improvements applied. If - temp_dew is not provided, then dew point improvements are not - applied. + ``temp_dew`` is not provided, then dew point improvements are not + applied. See :term:`temp_dew`. [°C] min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global - clearness index `kt`. Equivalent to zenith = 86.273 degrees. + clearness index `kt`. Equivalent to zenith = 86.273°. [°] max_zenith : numeric, default 87 Maximum value of zenith to allow in DNI calculation. DNI will be - set to 0 for times with zenith values greater than `max_zenith`. + set to 0 for times with zenith values greater than ``max_zenith``. [°] Returns ------- dni : array-like - The modeled direct normal irradiance in Wm⁻² provided by the - DIRINT model. + The modeled direct normal irradiance, as provided by the + DIRINT model. [Wm⁻²] Notes ----- @@ -2087,9 +2080,9 @@ def _dirint_coeffs(times, kt_prime, solar_zenith, w, delta_kt_prime): Parameters ---------- times : pd.DatetimeIndex - kt_prime : Zenith-independent clearness index - solar_zenith : Solar zenith angle - w : precipitable water estimated from surface dew-point temperature + kt_prime : Zenith-independent clearness index. [unitless] + solar_zenith : Solar zenith angle. [°] + w : precipitable water estimated from surface dew-point temperature. [cm] delta_kt_prime : stability index Returns @@ -2200,30 +2193,33 @@ def dirindex(ghi, ghi_clear, dni_clear, zenith, times, pressure=101325., Parameters ---------- ghi : array-like - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] ghi_clear : array-like - Global horizontal irradiance from clear sky model. [Wm⁻²] + Global horizontal irradiance from clear sky model. See + :term:`ghi_clear`. [Wm⁻²] .. versionchanged:: 0.11.2 Renamed from ``ghi_clearsky`` to ``ghi_clear``. dni_clear : array-like - Direct normal irradiance from clear sky model. [Wm⁻²] + Direct normal irradiance from clear sky model. See + :term:`dni_clear`. [Wm⁻²] .. versionchanged:: 0.11.2 Renamed from ``dni_clearsky`` to ``dni_clear``. zenith : array-like - True (not refraction-corrected) zenith angles in decimal - degrees. If Z is a vector it must be of the same size as all - other vector inputs. Z must be >=0 and <=180. + True (not refraction-corrected) zenith angles, must be >=0 and <=180. + If ``zenith`` is a vector, it must be of the same size as all other + vector inputs. See :term`solar_zenith`. [°] times : DatetimeIndex pressure : float or array-like, default 101325.0 - The site pressure in Pascal. Pressure may be measured or an - average pressure may be calculated from site altitude. + The site air pressure. Pressure may be measured or an + average pressure may be calculated from site altitude. See + :term:`pressure`. [Pa] use_delta_kt_prime : bool, default True If True, indicates that the stability index delta_kt_prime is @@ -2251,7 +2247,7 @@ def dirindex(ghi, ghi_clear, dni_clear, zenith, times, pressure=101325., Returns ------- dni : array-like - The modeled direct normal irradiance. [Wm⁻²] + The modeled direct normal irradiance. See :term:`dni`. [Wm⁻²] Notes ----- @@ -2303,35 +2299,32 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, Parameters ---------- poa_global : array-like - Plane of array global irradiance. [Wm⁻²] + Plane of array global irradiance. See :term:`poa_global`. [Wm⁻²] aoi : array-like Angle of incidence of solar rays with respect to the module - surface normal. + surface normal. See :term:`aoi`. [°] solar_zenith : array-like True (not refraction-corrected) solar zenith angles in decimal - degrees. + degrees. See :term:`solar_zenith`. [°] solar_azimuth : array-like - Solar azimuth angles. [°] + Solar azimuth angles. See :term:`solar_azimuth`. [°] times : DatetimeIndex - Time indices for the input array-like data + Time indices for the input array-like data. surface_tilt : numeric - Surface tilt angles. [°] Tilt must be >=0 and - <=180. The tilt angle is defined as degrees from horizontal - (e.g. surface facing up = 0, surface facing horizon = 90). + Surface tilt angle, see :term:`surface_tilt`. [°] surface_azimuth : numeric - Surface azimuth angles. [°] surface_azimuth must - be >=0 and <=360. The Azimuth convention is defined as degrees - east of north (e.g. North = 0, South=180 East = 90, West = 270). + Surface azimuth angles, see :term:`surface_azimuth`. [°] pressure : numeric, default 101325.0 The site pressure in Pascal. Pressure may be measured or an - average pressure may be calculated from site altitude. + average pressure may be calculated from site altitude. See + :term:`pressure`. [Pa] use_delta_kt_prime : bool, default True If True, indicates that the stability index delta_kt_prime is @@ -2342,14 +2335,14 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, input data must be Series. temp_dew : float, or array-like, optional - Surface dew point temperatures, in degrees C. Values of temp_dew + Surface dew point temperature. Values of ``temp_dew`` may be numeric or NaN. Any single time period point with a temp_dew=NaN does not have dew point improvements applied. If temp_dew is not provided, then dew point improvements are not - applied. + applied. See :term:`temp_dew`. [°C] albedo : numeric, default 0.25 - Ground surface albedo. [unitless] + Ground surface albedo. See :term:`albedo`. [unitless] model : String, default 'perez' Irradiance model. See :py:func:`get_sky_diffuse` for allowed values. @@ -2372,8 +2365,7 @@ def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, * ``ghi``: the modeled global horizontal irradiance. [Wm⁻²] * ``dni``: the modeled direct normal irradiance. [Wm⁻²] - * ``dhi``: the modeled diffuse horizontal irradiance in - Wm⁻². + * ``dhi``: the modeled diffuse horizontal irradiance. [Wm⁻²] References ---------- @@ -2649,18 +2641,19 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): Parameters ---------- ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] zenith: numeric - True (not refraction-corrected) zenith angles. [°] + True (not refraction-corrected) zenith angles. See + :term:`solar_zenith`. [°] datetime_or_doy : int, float, array, pd.DatetimeIndex Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global - clearness index `kt`. Equivalent to zenith = 86.273 degrees. + clearness index `kt`. Equivalent to zenith = 86.273°. max_zenith : numeric, default 87 Maximum value of zenith to allow in DNI calculation. DNI will be - set to 0 for times with zenith values greater than `max_zenith`. + set to 0 for times with zenith values greater than `max_zenith`. [°] Returns ------- @@ -2668,10 +2661,9 @@ def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): Contains the following keys/columns: * ``dni``: the modeled direct normal irradiance. [Wm⁻²] - * ``dhi``: the modeled diffuse horizontal irradiance in - Wm⁻². + * ``dhi``: the modeled diffuse horizontal irradiance [Wm⁻²]. * ``kt``: Ratio of global to extraterrestrial irradiance - on a horizontal plane. + on a horizontal plane. [unitless] References ---------- @@ -2747,23 +2739,30 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] + zenith: numeric - True (not refraction-corrected) zenith angles. [°] + True (not refraction-corrected) zenith angles. See + :term:`solar_zenith`. [°] + datetime_or_doy : int, float, array or pd.DatetimeIndex, optional Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. Either datetime_or_doy or dni_extra must be provided. + dni_extra : numeric, optional Extraterrestrial normal irradiance. - dni_extra can be provided if available to avoid recalculating it + ``dni_extra`` can be provided if available to avoid recalculating it inside this function. In this case datetime_or_doy is not required. + See :term:`dni_extra`. [Wm⁻²] + min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global - clearness index `kt`. Equivalent to zenith = 86.273 degrees. + clearness index `kt`. Equivalent to zenith = 86.273°. + max_zenith : numeric, default 87 Maximum value of zenith to allow in DNI calculation. DNI will be - set to 0 for times with zenith values greater than `max_zenith`. + set to 0 for times with zenith values greater than `max_zenith`. [°] Returns ------- @@ -2771,15 +2770,14 @@ def erbs_driesse(ghi, zenith, datetime_or_doy=None, dni_extra=None, Contains the following keys/columns: * ``dni``: the modeled direct normal irradiance. [Wm⁻²] - * ``dhi``: the modeled diffuse horizontal irradiance in - Wm⁻². + * ``dhi``: the modeled diffuse horizontal irradiance [Wm⁻²]. * ``kt``: Ratio of global to extraterrestrial irradiance - on a horizontal plane. + on a horizontal plane. [unitless] Raises ------ ValueError - If neither datetime_or_doy nor dni_extra is provided. + If neither ``datetime_or_doy`` nor ``dni_extra`` is provided. Notes ----- @@ -2868,20 +2866,30 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, Parameters ---------- ghi: numeric - Global horizontal irradiance. [Wm⁻²] + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] + zenith: numeric - True (not refraction-corrected) zenith angles. [°] - datetime_or_doy : int, float, array, pd.DatetimeIndex + True (not refraction-corrected) zenith angles. See + :term:`solar_zenith`. [°] + + datetime_or_doy : int, float, array or pd.DatetimeIndex, optional Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. + Either datetime_or_doy or dni_extra must be provided. + dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] + Extraterrestrial normal irradiance. + ``dni_extra`` can be provided if available to avoid recalculating it + inside this function. In this case datetime_or_doy is not required. + See :term:`dni_extra`. [Wm⁻²] + min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global - clearness index `kt`. Equivalent to zenith = 86.273 degrees. + clearness index `kt`. Equivalent to zenith = 86.273°. + max_zenith : numeric, default 87 Maximum value of zenith to allow in DNI calculation. DNI will be - set to 0 for times with zenith values greater than `max_zenith`. + set to 0 for times with zenith values greater than `max_zenith`. [°] Returns ------- @@ -2889,10 +2897,9 @@ def orgill_hollands(ghi, zenith, datetime_or_doy, dni_extra=None, Contains the following keys/columns: * ``dni``: the modeled direct normal irradiance. [Wm⁻²] - * ``dhi``: the modeled diffuse horizontal irradiance in - Wm⁻². + * ``dhi``: the modeled diffuse horizontal irradiance [Wm⁻²]. * ``kt``: Ratio of global to extraterrestrial irradiance - on a horizontal plane. + on a horizontal plane. [unitless] References ---------- @@ -2961,22 +2968,30 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, Parameters ---------- ghi: numeric - Global horizontal irradiance. [Wm⁻²] - solar_zenith: numeric - True (not refraction-corrected) zenith angles. [°] - datetime_or_doy : numeric, pandas.DatetimeIndex + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] + + zenith: numeric + True (not refraction-corrected) zenith angles. See + :term:`solar_zenith`. [°] + + datetime_or_doy : int, float, array or pd.DatetimeIndex, optional Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. + Either datetime_or_doy or dni_extra must be provided. + a_coeff : float, default 8.645 Logistic curve fit coefficient. + b_coeff : float, default 0.613 Logistic curve fit coefficient. + min_cos_zenith : numeric, default 0.065 Minimum value of cos(zenith) to allow when calculating global - clearness index :math:`k_t`. Equivalent to zenith = 86.273 degrees. + clearness index `kt`. Equivalent to zenith = 86.273°. + max_zenith : numeric, default 87 Maximum value of zenith to allow in DNI calculation. DNI will be - set to 0 for times with zenith values greater than `max_zenith`. + set to 0 for times with zenith values greater than `max_zenith`. [°] Returns ------- @@ -2984,10 +2999,9 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, Contains the following keys/columns: * ``dni``: the modeled direct normal irradiance. [Wm⁻²] - * ``dhi``: the modeled diffuse horizontal irradiance in - Wm⁻². + * ``dhi``: the modeled diffuse horizontal irradiance. [Wm⁻²] * ``kt``: Ratio of global to extraterrestrial irradiance - on a horizontal plane. + on a horizontal plane. [unitless] References ---------- @@ -3057,24 +3071,25 @@ def campbell_norman(zenith, transmittance, pressure=101325.0, Parameters ---------- zenith: pd.Series - True (not refraction-corrected) zenith angles in decimal - degrees. If Z is a vector it must be of the same size as all - other vector inputs. Z must be >=0 and <=180. + True (not refraction-corrected) zenith angles, must be >=0 and <=180. + If ``zenith`` is a vector, it must be of the same size as all other + vector inputs. [°] transmittance: float Atmospheric transmittance between 0 and 1. pressure: float, default 101325.0 - Air pressure + Air pressure. See :term:`pressure`. [Pa] dni_extra: float, default 1367.0 Direct irradiance incident at the top of the atmosphere. + See :term:`dni_extra`. [Wm⁻²] Returns ------- irradiance: DataFrame Modeled direct normal irradiance, direct horizontal irradiance, - and global horizontal irradiance in Wm⁻² + and global horizontal irradiance. [Wm⁻²] References ---------- @@ -3683,17 +3698,17 @@ def dni(ghi, dhi, zenith, dni_clear=None, clearsky_tolerance=1.1, Parameters ---------- ghi : Series - Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. + Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] dhi : Series - Diffuse horizontal irradiance. [Wm⁻²] See :term:`dhi`. + Diffuse horizontal irradiance. See :term:`dhi`. [Wm⁻²] zenith : Series - True (not refraction-corrected) zenith angles in decimal - degrees. Angles must be >=0 and <=180. + True (not refraction-corrected) zenith angles, must be >=0 and <=180. + See :term:`solar_zenith`. dni_clear : Series, optional - Clearsky direct normal irradiance. [Wm⁻²] See :term:`dni_clear`. + Clearsky direct normal irradiance. See :term:`dni_clear`. [Wm⁻²] .. versionchanged:: 0.11.2 Renamed from ``clearsky_dni`` to ``dni_clear``. @@ -3717,7 +3732,7 @@ def dni(ghi, dhi, zenith, dni_clear=None, clearsky_tolerance=1.1, Returns ------- dni : Series - The modeled direct normal irradiance. + The modeled direct normal irradiance. See :Term:`dni`. [Wm⁻²] """ # calculate DNI @@ -3763,37 +3778,50 @@ def complete_irradiance(solar_zenith, Parameters ---------- solar_zenith : series - Solar zenith angle. [°], with datetime index. + Solar zenith angle, with datetime index. Angles must be >=0 and <=180. Must have the same datetime index - as ghi, dhi, and dni series, when available. See :term:`solar_zenith`. + as ``ghi``, ``dhi``, and ``dni`` series, when available. + See :term:`solar_zenith`. + ghi : Series, optional Pandas series of dni data [Wm⁻²], with datetime index. Must have the same datetime index as dni, dhi, and zenith series, when available. See :term:`ghi`. + dhi : Series, optional - Pandas series of dni data [Wm⁻²], with datetime index. Must have the - same datetime index as ghi, dni, and zenith series, when available. - See :term:`dhi`. + Diffuse horizontal irradiance, with datetime index. Must have the + same datetime index as ``ghi``, ``dhi``, and ``solar_zenith``, when + available. See :term:`dhi`. [Wm⁻²] + dni : Series, optional Pandas series of dni data [Wm⁻²], with datetime index. Must have the same datetime index as ghi, dhi, and zenith series, when available. See :term:`dni`. + dni_clear : Series, optional Pandas series of clearsky dni data [Wm⁻²]. Must have the same datetime index as ghi, dhi, dni, and zenith series, when available. See :py:func:`dni` for details. + solar_azimuth : numeric - Solar azimuth angle. [°] + Solar azimuth angle. See :term:`solar_azimuth`. [°] + poa_global : numeric - Plane-of-array global irradiance, aka global tilted irradiance. [Wm⁻²] + Plane-of-array global irradiance, aka global tilted irradiance. + See :term:`poa_global`. [Wm⁻²] + dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. [Wm⁻²] + Extraterrestrial direct normal irradiance. See :term:`dni_extra`. + [Wm⁻²] + + Returns ------- component_sum_df : Dataframe Pandas series of 'ghi', 'dhi', and 'dni' columns with datetime index """ + if ghi is not None and dhi is not None and dni is None: dni = pvlib.irradiance.dni(ghi, dhi, solar_zenith, dni_clear=dni_clear, @@ -3822,11 +3850,11 @@ def louche(ghi, solar_zenith, datetime_or_doy, max_zenith=90): Parameters ---------- ghi : numeric - Global horizontal irradiance. [Wm⁻²] See :term:`ghi`. + Global horizontal irradiance, see :term:`ghi`. [Wm⁻²] solar_zenith : numeric - True (not refraction-corrected) zenith angles. [°] - Angles must be >=0° and <=90°. See :term:`solar_zenith`. + True (not refraction-corrected) zenith angle. + Angles must be >=0° and <=90°. See :term:`solar_zenith`. [°] datetime_or_doy : numeric, pandas.DatetimeIndex Day of year or array of days of year e.g. @@ -3837,11 +3865,12 @@ 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. [Wm⁻²] See :term:`dni` - * ``dhi``: the modeled diffuse horizontal irradiance. [Wm⁻²] - See :term:`dhi` - * ``kt``: Clearness index [unitless], ratio of global to - extraterrestrial irradiance on a horizontal plane. + * ``dni``: the modeled direct normal irradiance, see :term:`dni`. + [Wm⁻²] + * ``dhi``: the modeled diffuse horizontal irradiance, see :term:`dhi`. + [Wm⁻²] + * ``kt``: Clearness index. Ratio of global to + extraterrestrial irradiance on a horizontal plane. [unitless] References ------- @@ -3891,17 +3920,17 @@ def diffuse_par_spitters(daily_solar_zenith, global_diffuse_fraction): Parameters ---------- daily_solar_zenith : numeric - Average daily solar zenith angle. [°] + Average daily solar zenith angle. See :term:`solar_zenith`. [°] global_diffuse_fraction : numeric - Fraction of daily global broadband insolation that is diffuse. - Unitless [0, 1] + Fraction of daily global broadband insolation that is diffuse, between + 0 and 1. [unitless] Returns ------- par_diffuse_fraction : numeric Fraction of daily photosynthetically active radiation (PAR) that is - diffuse. Unitless [0, 1] + diffuse, between 0 and 1. [unitless] Notes ----- From 6871016992341488b0f8c45a8a466baae26df2c4 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 25 Apr 2025 14:54:09 -0600 Subject: [PATCH 11/15] remove unintended 'optional' for solar_zenith --- pvlib/irradiance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 747db08cf2..4180b8fda3 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -901,7 +901,7 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, dni_extra : numeric Extraterrestrial normal irradiance, see :term:`dni_extra`. [Wm⁻²] - solar_zenith : numeric, optional + solar_zenith : numeric Solar apparent (refraction-corrected) zenith angles. Must supply ``solar_zenith`` and ``solar_azimuth``, or supply ``projection_ratio``. See :term:`solar_zenith`. [°] @@ -1005,7 +1005,7 @@ def king(surface_tilt, dhi, ghi, solar_zenith): ghi : numeric Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] - solar_zenith : numeric, optional + solar_zenith : numeric Solar apparent (refraction-corrected) zenith angles. See :term:`solar_zenith`. [°] From d2ed433918e5b427bedf22dc63c5d7230ec57f93 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 25 Apr 2025 15:01:58 -0600 Subject: [PATCH 12/15] add ghi --- pvlib/irradiance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 4180b8fda3..f76803e48a 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -897,6 +897,8 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, dni : numeric Direct normal irradiance, see :term:`dni`. [Wm⁻²] + ghi : numeric + Global horizontal irradiance, see :term:`ghi`. [Wm⁻²] dni_extra : numeric Extraterrestrial normal irradiance, see :term:`dni_extra`. [Wm⁻²] From 2717fa7472a562e838188939845ce8ef4c73c651 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 25 Apr 2025 15:02:56 -0600 Subject: [PATCH 13/15] 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 f76803e48a..ee885d1d2f 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -897,6 +897,7 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, dni : numeric Direct normal irradiance, see :term:`dni`. [Wm⁻²] + ghi : numeric Global horizontal irradiance, see :term:`ghi`. [Wm⁻²] @@ -904,8 +905,7 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Extraterrestrial normal irradiance, see :term:`dni_extra`. [Wm⁻²] solar_zenith : numeric - Solar apparent (refraction-corrected) zenith angles. Must supply - ``solar_zenith`` and ``solar_azimuth``, or supply ``projection_ratio``. + Solar apparent (refraction-corrected) zenith angles. See :term:`solar_zenith`. [°] solar_azimuth : numeric, optional From be7c32eb8c37e8247aead1cb5df0b271ed16184a Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 25 Apr 2025 15:07:42 -0600 Subject: [PATCH 14/15] more untis --- pvlib/irradiance.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index ee885d1d2f..a0a595ed2b 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -661,7 +661,7 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, solar_zenith : numeric Apparent (refraction-corrected) zenith angles. - ``solar_zenith`` must be >=0° and <=180. See :term:`solar_zenith`. [°] + ``solar_zenith`` must be >=0° and <=180°. See :term:`solar_zenith`. [°] solar_azimuth : numeric Sun azimuth angles. ``solar_azimuth`` must be >=0° and <=360. See @@ -2212,7 +2212,7 @@ def dirindex(ghi, ghi_clear, dni_clear, zenith, times, pressure=101325., Renamed from ``dni_clearsky`` to ``dni_clear``. zenith : array-like - True (not refraction-corrected) zenith angles, must be >=0 and <=180. + True (not refraction-corrected) zenith angles, must be >=0° and <=180°. If ``zenith`` is a vector, it must be of the same size as all other vector inputs. See :term`solar_zenith`. [°] @@ -3073,7 +3073,7 @@ def campbell_norman(zenith, transmittance, pressure=101325.0, Parameters ---------- zenith: pd.Series - True (not refraction-corrected) zenith angles, must be >=0 and <=180. + True (not refraction-corrected) zenith angles, must be >=0° and <=180°. If ``zenith`` is a vector, it must be of the same size as all other vector inputs. [°] @@ -3133,7 +3133,7 @@ def _liujordan(zenith, transmittance, airmass, dni_extra=1367.0): zenith: pd.Series True (not refraction-corrected) zenith angles in decimal degrees. If Z is a vector it must be of the same size as all - other vector inputs. Z must be >=0 and <=180. + other vector inputs. ``zenith`` must be >=0° and <=180°. transmittance: float Atmospheric transmittance between 0 and 1. @@ -3706,7 +3706,7 @@ def dni(ghi, dhi, zenith, dni_clear=None, clearsky_tolerance=1.1, Diffuse horizontal irradiance. See :term:`dhi`. [Wm⁻²] zenith : Series - True (not refraction-corrected) zenith angles, must be >=0 and <=180. + True (not refraction-corrected) zenith angles, must be >=0° and <=180°. See :term:`solar_zenith`. dni_clear : Series, optional @@ -3781,14 +3781,14 @@ def complete_irradiance(solar_zenith, ---------- solar_zenith : series Solar zenith angle, with datetime index. - Angles must be >=0 and <=180. Must have the same datetime index + Angles must be >=0° and <=180°. Must have the same datetime index as ``ghi``, ``dhi``, and ``dni`` series, when available. - See :term:`solar_zenith`. + See :term:`solar_zenith`. [°] ghi : Series, optional Pandas series of dni data [Wm⁻²], with datetime index. Must have the same datetime index as dni, dhi, and zenith series, when available. - See :term:`ghi`. + See :term:`ghi`. [Wm⁻²] dhi : Series, optional Diffuse horizontal irradiance, with datetime index. Must have the @@ -3798,12 +3798,12 @@ def complete_irradiance(solar_zenith, dni : Series, optional Pandas series of dni data [Wm⁻²], with datetime index. Must have the same datetime index as ghi, dhi, and zenith series, when available. - See :term:`dni`. + See :term:`dni`. [Wm⁻²] dni_clear : Series, optional Pandas series of clearsky dni data [Wm⁻²]. Must have the same datetime index as ghi, dhi, dni, and zenith series, when available. See - :py:func:`dni` for details. + :py:func:`dni` for details. [Wm⁻²] solar_azimuth : numeric Solar azimuth angle. See :term:`solar_azimuth`. [°] From 0e3731e83597cb5b44e6bbb768abc4c0b030285d Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 25 Apr 2025 15:16:12 -0600 Subject: [PATCH 15/15] Update irradiance.py --- pvlib/irradiance.py | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index a0a595ed2b..8f4155267e 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -908,7 +908,7 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, Solar apparent (refraction-corrected) zenith angles. See :term:`solar_zenith`. [°] - solar_azimuth : numeric, optional + solar_azimuth : numeric Solar azimuth angles. See :term:`solar_azimuth`. [°] Returns @@ -1339,7 +1339,7 @@ def perez_driesse(surface_tilt, surface_azimuth, dhi, dni, dni_extra, Solar azimuth angle, must be >=0° and <=360°. See :term:`solar_azimuth`. [°] - airmass : numeric + airmass : numeric, optional Relative (not pressure-corrected) airmass values. If AM is a DataFrame it must be of the same size as all other DataFrame inputs. AM must be >=0 (careful using the 1/sec(z) model of AM @@ -1944,7 +1944,7 @@ def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, ghi : array-like Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] - solar_zenith : numeric + solar_zenith : array-like True (not refraction-corrected) solar zenith angles. See :term:`solar_zenith`. [°] @@ -2972,14 +2972,13 @@ def boland(ghi, solar_zenith, datetime_or_doy, a_coeff=8.645, b_coeff=0.613, ghi: numeric Global horizontal irradiance. See :term:`ghi`. [Wm⁻²] - zenith: numeric + solar_zenith: numeric True (not refraction-corrected) zenith angles. See :term:`solar_zenith`. [°] - datetime_or_doy : int, float, array or pd.DatetimeIndex, optional - Day of year or array of days of year e.g. - pd.DatetimeIndex.dayofyear, or pd.DatetimeIndex. - Either datetime_or_doy or dni_extra must be provided. + datetime_or_doy : numeric or pd.DatetimeIndex. + Day of year or array of days of year e.g. pd.DatetimeIndex.dayofyear, + or pd.DatetimeIndex. a_coeff : float, default 8.645 Logistic curve fit coefficient. @@ -3805,19 +3804,6 @@ def complete_irradiance(solar_zenith, index as ghi, dhi, dni, and zenith series, when available. See :py:func:`dni` for details. [Wm⁻²] - solar_azimuth : numeric - Solar azimuth angle. See :term:`solar_azimuth`. [°] - - poa_global : numeric - Plane-of-array global irradiance, aka global tilted irradiance. - See :term:`poa_global`. [Wm⁻²] - - dni_extra : numeric, optional - Extraterrestrial direct normal irradiance. See :term:`dni_extra`. - [Wm⁻²] - - - Returns ------- component_sum_df : Dataframe