Skip to content

Commit 3015b3a

Browse files
committed
Update mismatch.py
1 parent 3df13ae commit 3015b3a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pvlib/spectrum/mismatch.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,9 @@ def spectral_factor_polo(precipitable_water, airmass_absolute, aod500, aoi,
759759
if module_type is not None and coefficients is not None:
760760
raise ValueError('Only one of `module_type` and `coefficients` should '
761761
'be provided')
762+
# prevent nan for aoi greater than 90
763+
if aoi > 90:
764+
aoi = 90
762765
f_aoi_rel = pvlib.atmosphere.get_relative_airmass(aoi,
763766
model='kastenyoung1989')
764767
f_aoi = pvlib.atmosphere.get_absolute_airmass(f_aoi_rel, pressure)
@@ -786,8 +789,4 @@ def spectral_factor_polo(precipitable_water, airmass_absolute, aod500, aoi,
786789
# Ground albedo correction
787790
g = c_albedo[0] * (albedo/0.2)**2 \
788791
+ c_albedo[1] * (albedo/0.2) + c_albedo[2]
789-
# if aoi > 90 no ilumination, no spectral correction
790-
if aoi > 90:
791-
g=1
792-
smm=1
793792
return g*smm

0 commit comments

Comments
 (0)