Skip to content

Commit

Permalink
clip to [-1, 1]
Browse files Browse the repository at this point in the history
  • Loading branch information
kandersolar committed Mar 10, 2021
1 parent dc617d0 commit 8069470
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ def aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth):
tools.sind(surface_tilt) * tools.sind(solar_zenith) *
tools.cosd(solar_azimuth - surface_azimuth))

# GH 1185
projection = np.clip(projection, -1, 1)

try:
projection.name = 'aoi_projection'
except AttributeError:
Expand Down

0 comments on commit 8069470

Please sign in to comment.