Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
3 changes: 2 additions & 1 deletion docs/sphinx/source/whatsnew/v0.11.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Deprecations

Enhancements
~~~~~~~~~~~~

Fix syntax for unshaded ground fraction (:issue:`2245`, :pull:`2359`)
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
Fix syntax for unshaded ground fraction (:issue:`2245`, :pull:`2359`)
Fix bug in :py:func:`pvlib.bifacial.get_irradiance_poa` which may had yielded non-zero ground irradiance with sun below horizon (:issue:`2245`, :pull:`2359`)


Documentation
~~~~~~~~~~~~~
Expand All @@ -36,3 +36,4 @@ Contributors
~~~~~~~~~~~~
* Rajiv Daxini (:ghuser:`RDaxini`)
* Mark Campanelli (:ghuser:`markcampanelli`)
* Jason Lun Leung (:ghuser:`jason-rpkt`)
8 changes: 5 additions & 3 deletions pvlib/bifacial/infinite_sheds.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +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 .

descriptions of content.
Output is a "pandas.DataFrame" when "ghi" is a Series.
Otherwise it is a dict of "numpy.ndarray"
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
Member

@cwhanse cwhanse Jan 28, 2025

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 "pandas.DataFrame" when "ghi" is a Series.
Otherwise it is a dict of "numpy.ndarray"
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.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry about that double recommendation, it's my company firewall getting in the way of following links.


Notes
-----
Expand Down Expand Up @@ -372,7 +374,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(ghi, 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
Loading