@@ -312,7 +312,7 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
312312 dni_extra = None , airmass = None , albedo = None ,
313313 model = 'haydavies' , ** kwargs ):
314314 """
315- Uses the :py:func:`irradiance.get_total_irradiance` function to
315+ Uses :py:func:`pvlib. irradiance.get_total_irradiance` to
316316 calculate the plane of array irradiance components on the tilted
317317 surfaces defined by each array's ``surface_tilt`` and
318318 ``surface_azimuth``.
@@ -323,11 +323,11 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
323323 Solar zenith angle.
324324 solar_azimuth : float or Series
325325 Solar azimuth angle.
326- dni : float or Series or tuple of float or Series
326+ dni : float, Series, or tuple of float or Series
327327 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
329329 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
331331 Diffuse horizontal irradiance. [W/m2]
332332 dni_extra : float, Series or tuple of float or Series, optional
333333 Extraterrestrial direct normal irradiance. [W/m2]
@@ -339,15 +339,22 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
339339 Irradiance model.
340340
341341 kwargs
342- Extra parameters passed to :func:`irradiance.get_total_irradiance`.
342+ Extra parameters passed to
343+ :py:func:`pvlib.irradiance.get_total_irradiance`.
343344
344345 Notes
345346 -----
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.
351358
352359 Returns
353360 -------
@@ -1077,7 +1084,7 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
10771084 """
10781085 Get plane of array irradiance components.
10791086
1080- Uses the :py:func:`pvlib.irradiance.get_total_irradiance` function to
1087+ Uses :py:func:`pvlib.irradiance.get_total_irradiance` to
10811088 calculate the plane of array irradiance components for a surface
10821089 defined by ``self.surface_tilt`` and ``self.surface_azimuth``.
10831090
@@ -1112,16 +1119,30 @@ def get_irradiance(self, solar_zenith, solar_azimuth, dni, ghi, dhi,
11121119 Column names are: ``'poa_global', 'poa_direct', 'poa_diffuse',
11131120 'poa_sky_diffuse', 'poa_ground_diffuse'``.
11141121
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+
11151129 See also
11161130 --------
11171131 :py:func:`pvlib.irradiance.get_total_irradiance`
11181132 """
11191133 if albedo is None :
11201134 albedo = self .albedo
11211135
1122- # not needed for all models, but this is easier
1136+ # dni_extra is not needed for all models, but this is easier
11231137 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
11251146
11261147 if airmass is None :
11271148 airmass = atmosphere .get_relative_airmass (solar_zenith )
0 commit comments