@@ -152,7 +152,8 @@ def _handle_extra_radiation_types(datetime_or_doy, epoch_year):
152
152
return to_doy , to_datetimeindex , to_output
153
153
154
154
155
- def aoi_projection (surface_tilt , surface_azimuth , solar_zenith , solar_azimuth ):
155
+ def aoi_projection (surface_tilt , surface_azimuth , solar_zenith , solar_azimuth ,
156
+ projection_minimum = None ):
156
157
"""
157
158
Calculates the dot product of the solar vector and the surface
158
159
normal.
@@ -169,6 +170,11 @@ def aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth):
169
170
Solar zenith angle.
170
171
solar_azimuth : numeric
171
172
Solar azimuth angle.
173
+ projection_minimum : None or numeric, default None
174
+ Minimum allowable value for the projection for the solar angle
175
+ into the plane of the array. For example, 0 is equivalent to a
176
+ 90 degree limit, 0.01745 is equivalent to a 89 degree limit.
177
+ `None` applies no limit.
172
178
173
179
Returns
174
180
-------
@@ -181,6 +187,9 @@ def aoi_projection(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth):
181
187
tools .sind (surface_tilt ) * tools .sind (solar_zenith ) *
182
188
tools .cosd (solar_azimuth - surface_azimuth ))
183
189
190
+ if projection_minimum is not None :
191
+ projection = np .maximum (projection , projection_minimum )
192
+
184
193
try :
185
194
projection .name = 'aoi_projection'
186
195
except AttributeError :
@@ -226,7 +235,9 @@ def aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth):
226
235
227
236
228
237
def poa_horizontal_ratio (surface_tilt , surface_azimuth ,
229
- solar_zenith , solar_azimuth ):
238
+ solar_zenith , solar_azimuth ,
239
+ poa_projection_minimum = None ,
240
+ solar_zenith_projection_minimum = None ):
230
241
"""
231
242
Calculates the ratio of the beam components of the plane of array
232
243
irradiance and the horizontal irradiance.
@@ -243,6 +254,12 @@ def poa_horizontal_ratio(surface_tilt, surface_azimuth,
243
254
Solar zenith angle.
244
255
solar_azimuth : numeric
245
256
Solar azimuth angle.
257
+ poa_projection_minimum : None or numeric, default None
258
+ Minimum allowable value for the projection for the solar angle
259
+ into the plane of the array. `None` applies no limit.
260
+ solar_zenith_projection_minimum : numeric, default None
261
+ Minimum allowable value for the projection of the solar angle
262
+ on to a horizontal surface. `None` applies no limit.
246
263
247
264
Returns
248
265
-------
@@ -252,10 +269,15 @@ def poa_horizontal_ratio(surface_tilt, surface_azimuth,
252
269
"""
253
270
254
271
cos_poa_zen = aoi_projection (surface_tilt , surface_azimuth ,
255
- solar_zenith , solar_azimuth )
272
+ solar_zenith , solar_azimuth ,
273
+ projection_minimum = poa_projection_minimum )
256
274
257
275
cos_solar_zenith = tools .cosd (solar_zenith )
258
276
277
+ if solar_zenith_projection_minimum is not None :
278
+ cos_solar_zenith = np .maximum (cos_solar_zenith ,
279
+ solar_zenith_projection_minimum )
280
+
259
281
# ratio of titled and horizontal beam irradiance
260
282
ratio = cos_poa_zen / cos_solar_zenith
261
283
@@ -745,7 +767,8 @@ def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith,
745
767
746
768
# zenith angle with respect to panel normal.
747
769
cos_tt = aoi_projection (surface_tilt , surface_azimuth ,
748
- solar_zenith , solar_azimuth )
770
+ solar_zenith , solar_azimuth ,
771
+ projection_minimum = 0 )
749
772
750
773
F = 1 - ((dhi / ghi ) ** 2 )
751
774
try :
@@ -835,8 +858,9 @@ def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
835
858
# if necessary, calculate ratio of titled and horizontal beam irradiance
836
859
if projection_ratio is None :
837
860
cos_tt = aoi_projection (surface_tilt , surface_azimuth ,
838
- solar_zenith , solar_azimuth )
839
- cos_solar_zenith = tools .cosd (solar_zenith )
861
+ solar_zenith , solar_azimuth ,
862
+ projection_minimum = 0 )
863
+ cos_solar_zenith = np .maximum (tools .cosd (solar_zenith ), 0.01745 )
840
864
Rb = cos_tt / cos_solar_zenith
841
865
else :
842
866
Rb = projection_ratio
@@ -931,9 +955,10 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra,
931
955
'''
932
956
933
957
cos_tt = aoi_projection (surface_tilt , surface_azimuth ,
934
- solar_zenith , solar_azimuth )
958
+ solar_zenith , solar_azimuth ,
959
+ projection_minimum = 0 )
935
960
936
- cos_solar_zenith = tools .cosd (solar_zenith )
961
+ cos_solar_zenith = np . maximum ( tools .cosd (solar_zenith ), 0.01745 )
937
962
938
963
# ratio of titled and horizontal beam irradiance
939
964
Rb = cos_tt / cos_solar_zenith
0 commit comments