@@ -272,18 +272,24 @@ def projected_solar_zenith_angle(surface_tilt, surface_azimuth,
272
272
Progress in Photovoltaics: Research and Applications, vol. 19, no. 6,
273
273
pp. 747–753, 2011, :doi:`10.1002/pip.1085`.
274
274
"""
275
- # Notation from [1]
276
- sx = cosd (solar_apparent_elevation ) * sind (solar_azimuth )
277
- sy = cosd (solar_apparent_elevation ) * cosd (solar_azimuth )
278
- sz = sind (solar_apparent_elevation )
275
+ # Avoid recalculating these values
276
+ cosd_solar_apparent_elevation = cosd (solar_apparent_elevation )
279
277
cosd_surface_azimuth = cosd (surface_azimuth )
280
278
sind_surface_azimuth = sind (surface_azimuth )
281
279
sind_surface_tilt = sind (surface_tilt )
280
+
281
+ # Notation from [1]
282
+ # Sun's x, y, z coords
283
+ sx = cosd_solar_apparent_elevation * sind (solar_azimuth )
284
+ sy = cosd_solar_apparent_elevation * cosd (solar_azimuth )
285
+ sz = sind (solar_apparent_elevation )
286
+ # Eq. (4); sx', sz' values from sun coordinates projected onto surface
282
287
sx_prime = sx * cosd_surface_azimuth - sy * sind_surface_azimuth
283
288
sz_prime = (
284
289
sx * sind_surface_azimuth * sind_surface_tilt
285
290
+ sy * sind_surface_tilt * cosd_surface_azimuth
286
291
+ sz * cosd (surface_tilt )
287
292
)
293
+ # Eq. (5); angle between sun's beam and surface
288
294
theta_T = np .degrees (np .arctan2 (sx_prime , sz_prime ))
289
295
return theta_T
0 commit comments