@@ -312,7 +312,7 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
312
312
dni_extra = None , airmass = None , albedo = None ,
313
313
model = 'haydavies' , ** kwargs ):
314
314
"""
315
- Uses the :py:func:`irradiance.get_total_irradiance` function to
315
+ Uses :py:func:`pvlib. irradiance.get_total_irradiance` to
316
316
calculate the plane of array irradiance components on the tilted
317
317
surfaces defined by each array's ``surface_tilt`` and
318
318
``surface_azimuth``.
@@ -323,11 +323,11 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
323
323
Solar zenith angle.
324
324
solar_azimuth : float or Series
325
325
Solar azimuth angle.
326
- dni : float or Series or tuple of float or Series
326
+ dni : float, Series, or tuple of float or Series
327
327
Direct Normal Irradiance. [W/m2]
328
- ghi : float or Series or tuple of float or Series
328
+ ghi : float, Series, or tuple of float or Series
329
329
Global horizontal irradiance. [W/m2]
330
- dhi : float or Series or tuple of float or Series
330
+ dhi : float, Series, or tuple of float or Series
331
331
Diffuse horizontal irradiance. [W/m2]
332
332
dni_extra : float, Series or tuple of float or Series, optional
333
333
Extraterrestrial direct normal irradiance. [W/m2]
@@ -339,15 +339,22 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
339
339
Irradiance model.
340
340
341
341
kwargs
342
- Extra parameters passed to :func:`irradiance.get_total_irradiance`.
342
+ Extra parameters passed to
343
+ :py:func:`pvlib.irradiance.get_total_irradiance`.
343
344
344
345
Notes
345
346
-----
346
- Each of `dni`, `ghi`, and `dni` parameters may be passed as a tuple
347
- to provide different irradiance for each array in the system. If not
348
- passed as a tuple then the same value is used for input to each Array.
349
- If passed as a tuple the length must be the same as the number of
350
- Arrays.
347
+ Each of ``dni``, ``ghi``, and ``dni`` may be passed as a float, Series,
348
+ or tuple of float or Series. If passed as a float or Series, these
349
+ values are used for all Arrays. If passed as a tuple, the tuple length
350
+ must be the same as the number of Arrays. The first tuple element is
351
+ used for the first Array, the second tuple element for the second
352
+ Array, and so forth.
353
+
354
+ Some sky irradiance models require ``dni_extra``. For these models,
355
+ if ``dni_extra`` is not provided and ``solar_zenith`` has a
356
+ ``DatetimeIndex``, then ``dni_extra`` is calculated.
357
+ Otherwise, ``dni_extra=1367`` is assumed.
351
358
352
359
Returns
353
360
-------
@@ -1077,7 +1084,7 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
1077
1084
"""
1078
1085
Get plane of array irradiance components.
1079
1086
1080
- Uses the :py:func:`pvlib.irradiance.get_total_irradiance` function to
1087
+ Uses :py:func:`pvlib.irradiance.get_total_irradiance` to
1081
1088
calculate the plane of array irradiance components for a surface
1082
1089
defined by ``self.surface_tilt`` and ``self.surface_azimuth``.
1083
1090
@@ -1112,16 +1119,30 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
1112
1119
Column names are: ``'poa_global', 'poa_direct', 'poa_diffuse',
1113
1120
'poa_sky_diffuse', 'poa_ground_diffuse'``.
1114
1121
1122
+ Notes
1123
+ -----
1124
+ Some sky irradiance models require ``dni_extra``. For these models,
1125
+ if ``dni_extra`` is not provided and ``solar_zenith`` has a
1126
+ ``DatetimeIndex``, then ``dni_extra`` is calculated.
1127
+ Otherwise, ``dni_extra=1367`` is assumed.
1128
+
1115
1129
See also
1116
1130
--------
1117
1131
:py:func:`pvlib.irradiance.get_total_irradiance`
1118
1132
"""
1119
1133
if albedo is None :
1120
1134
albedo = self .albedo
1121
1135
1122
- # not needed for all models, but this is easier
1136
+ # dni_extra is not needed for all models, but this is easier
1123
1137
if dni_extra is None :
1124
- dni_extra = irradiance .get_extra_radiation (solar_zenith .index )
1138
+ if (hasattr (solar_zenith , 'index' ) and
1139
+ isinstance (solar_zenith .index , pd .DatetimeIndex )):
1140
+ # calculate extraterrestrial irradiance
1141
+ dni_extra = irradiance .get_extra_radiation (
1142
+ solar_zenith .index )
1143
+ else :
1144
+ # use the solar constant
1145
+ dni_extra = 1367.0
1125
1146
1126
1147
if airmass is None :
1127
1148
airmass = atmosphere .get_relative_airmass (solar_zenith )
0 commit comments