Skip to content

Commit 6e794cd

Browse files
cwhansekandersolar
andauthored
Update pvlib/pvsystem.py
Co-authored-by: Kevin Anderson <[email protected]>
1 parent 9103a36 commit 6e794cd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pvlib/pvsystem.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,12 +1134,13 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
11341134
albedo = self.albedo
11351135

11361136
# dni_extra is not needed for all models, but this is easier
1137-
if (dni_extra is None and hasattr(solar_zenith, 'index')
1138-
and isinstance(solar_zenith.index, pd.DatetimeIndex)):
1139-
dni_extra = irradiance.get_extra_radiation(solar_zenith.index)
1140-
else:
1141-
# use the solar constant
1142-
dni_extra = 1367
1137+
if dni_extra is None:
1138+
if (hasattr(solar_zenith, 'index') and
1139+
isinstance(solar_zenith.index, pd.DatetimeIndex)):
1140+
dni_extra = irradiance.get_extra_radiation(solar_zenith.index)
1141+
else:
1142+
# use the solar constant
1143+
dni_extra = 1367
11431144

11441145
if airmass is None:
11451146
airmass = atmosphere.get_relative_airmass(solar_zenith)

0 commit comments

Comments
 (0)