Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pvlib/bifacial/infinite_sheds.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
Returns
-------
output : dict or DataFrame
Output is a DataFrame when input ghi is a Series. See Notes for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I read this, I think I should have suggested following the type of ghi instead of solar_zenith. Sorry for the confusion @jason-rpkt .

Output is a DataFrame when solar_zenith is a Series.
solar_zenith is the one that sets the output type.
See Issue #2245
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See Issue #2245

See Notes for
descriptions of content.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Output is a DataFrame when solar_zenith is a Series.
solar_zenith is the one that sets the output type.
See Issue #2245
See Notes for
descriptions of content.
Output is a ``pandas.DataFrame`` when ``ghi`` is a Series,
otherwise it is a dict of ``numpy.ndarray``.
See Notes for descriptions of content.


Notes
Expand Down Expand Up @@ -372,7 +375,7 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
'poa_global': poa_global, 'poa_direct': poa_direct,
'poa_diffuse': poa_diffuse, 'poa_ground_diffuse': poa_gnd_pv,
'poa_sky_diffuse': poa_sky_pv, 'shaded_fraction': f_x}
if isinstance(poa_global, pd.Series):
if isinstance(solar_zenith, pd.Series):
output = pd.DataFrame(output)
return output

Expand Down
3 changes: 2 additions & 1 deletion pvlib/bifacial/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def _unshaded_ground_fraction(surface_tilt, surface_azimuth, solar_zenith,
surface_azimuth)
f_gnd_beam = 1.0 - np.minimum(
1.0, gcr * np.abs(cosd(surface_tilt) + sind(surface_tilt) * tan_phi))
np.where(solar_zenith > max_zenith, 0., f_gnd_beam) # [1], Eq. 4
f_gnd_beam = np.where(solar_zenith > max_zenith, 0., f_gnd_beam)
# [1], Eq. 4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f_gnd_beam = np.where(solar_zenith > max_zenith, 0., f_gnd_beam)
# [1], Eq. 4
# [1], Eq. 4
f_gnd_beam = np.where(solar_zenith > max_zenith, 0., f_gnd_beam)

return f_gnd_beam # 1 - min(1, abs()) < 1 always


Expand Down