Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
return sky_diffuse


def disc(ghi, zenith, datetime_or_doy, pressure=101325):
def disc(ghi, zenith, datetime_or_doy, pressure=101325, zenith_threshold=87.):
"""
Estimate Direct Normal Irradiance from Global Horizontal Irradiance
using the DISC model.
Expand All @@ -1094,6 +1094,9 @@ def disc(ghi, zenith, datetime_or_doy, pressure=101325):
pressure : numeric
Site pressure in Pascal.

zenith_threshold: numeric
Filtering threshold on zenith angles in decimal degrees.

Returns
-------
output : OrderedDict or DataFrame
Expand Down Expand Up @@ -1155,7 +1158,7 @@ def disc(ghi, zenith, datetime_or_doy, pressure=101325):

dni = Kn * I0

dni = np.where((zenith > 87) | (ghi < 0) | (dni < 0), 0, dni)
dni = np.where((zenith > zenith_threshold) | (ghi < 0) | (dni < 0), 0, dni)

output = OrderedDict()
output['dni'] = dni
Expand Down