Skip to content

Commit

Permalink
irradiance.py: dni(), _get_dirint_coeffs(), complete_irradiance()
Browse files Browse the repository at this point in the history
  • Loading branch information
RDaxini committed Oct 21, 2024
1 parent bc5a7ad commit d431aa8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3600,7 +3600,7 @@ def _get_dirint_coeffs():
return coeffs[1:, 1:, :, :]


def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1,
def dni(ghi, dhi, zenith, dni_clear=None, clearsky_tolerance=1.1,
zenith_threshold_for_zero_dni=88.0,
zenith_threshold_for_clearsky_limit=80.0):
"""
Expand All @@ -3624,11 +3624,11 @@ def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1,
True (not refraction-corrected) zenith angles in decimal
degrees. Angles must be >=0 and <=180.
clearsky_dni : Series, optional
dni_clear : Series, optional
Clearsky direct normal irradiance.
clearsky_tolerance : float, default 1.1
If 'clearsky_dni' is given this parameter can be used to allow a
If `dni_clear` is given this parameter can be used to allow a
tolerance by how much the calculated DNI value can be greater than
the clearsky value before it is identified as an unreasonable value.
Expand All @@ -3641,7 +3641,7 @@ def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1,
'zenith_threshold_for_clearsky_limit' and smaller the
'zenith_threshold_for_zero_dni' that are greater than the clearsky DNI
(times allowed tolerance) will be corrected. Only applies if
'clearsky_dni' is not None.
`dni_clear` is not None.
Returns
-------
Expand All @@ -3663,8 +3663,8 @@ def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1,
# zenith_threshold_for_clearsky_limit and smaller than the
# upper_cutoff_zenith that are greater than the clearsky DNI (times
# clearsky_tolerance)
if clearsky_dni is not None:
max_dni = clearsky_dni * clearsky_tolerance
if dni_clear is not None:
max_dni = dni_clear * clearsky_tolerance
dni[(zenith >= zenith_threshold_for_clearsky_limit) &
(zenith < zenith_threshold_for_zero_dni) &
(dni > max_dni)] = max_dni
Expand Down Expand Up @@ -3716,7 +3716,7 @@ def complete_irradiance(solar_zenith,
"""
if ghi is not None and dhi is not None and dni is None:
dni = pvlib.irradiance.dni(ghi, dhi, solar_zenith,
clearsky_dni=dni_clear,
dni_clear=dni_clear,
clearsky_tolerance=1.1)
elif dni is not None and dhi is not None and ghi is None:
ghi = (dhi + dni * tools.cosd(solar_zenith))
Expand Down

0 comments on commit d431aa8

Please sign in to comment.