Skip to content

Commit 0b9d138

Browse files
author
Kempe
committed
Update spectral.py
Making the default azimuth be equatorial facing instead of always south. No northern-centric bias here. ;)
1 parent 48e5632 commit 0b9d138

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pvdeg/spectral.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def solar_position(weather_df, meta):
4242

4343

4444
def poa_irradiance(
45-
weather_df, meta, sol_position=None, tilt=None, azimuth=180, sky_model="isotropic"
45+
weather_df, meta, sol_position=None, tilt=None, azimuth=None, sky_model="isotropic"
4646
):
4747
"""
4848
Calculate plane-of-array (POA) irradiance using pvlib based on weather data from the
@@ -60,7 +60,7 @@ def poa_irradiance(
6060
The tilt angle of the PV panels in degrees, if None, the latitude of the
6161
location is used.
6262
azimuth : float, optional
63-
The azimuth angle of the PV panels in degrees, 180 by default - facing south.
63+
The azimuth angle of the PV panels in degrees. Equatorial facing by default.
6464
sky_model : str, optional
6565
The pvlib sky model to use, 'isotropic' by default.
6666
@@ -74,6 +74,11 @@ def poa_irradiance(
7474
# TODO: change for handling HSAT tracking passed or requested
7575
if tilt is None:
7676
tilt = float(meta["latitude"])
77+
if azimuth is None: #Sets the default orientation to equator facing.
78+
if float(meta['latitude']) < 0:
79+
azimuth=0
80+
else:
81+
azimuth=180
7782

7883
if sol_position is None:
7984
sol_position = solar_position(weather_df, meta)

0 commit comments

Comments
 (0)