Skip to content

Commit a948268

Browse files
committed
Merge branch 'enhancement-semi-integration' of https://github.com/Muhammad-Rebaal/pvlib-python into pr/2415
2 parents dff2daf + 6f51c24 commit a948268

File tree

9 files changed

+146
-135
lines changed

9 files changed

+146
-135
lines changed

docs/sphinx/source/reference/iotools.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ of sources and file formats relevant to solar energy modeling.
3131
iotools.get_nsrdb_psm4_conus
3232
iotools.get_nsrdb_psm4_full_disc
3333
iotools.read_nsrdb_psm4
34-
iotools.parse_nsrdb_psm4
3534
iotools.get_psm3
3635
iotools.read_psm3
3736
iotools.parse_psm3

docs/sphinx/source/whatsnew/v0.12.1.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ Enhancements
2727
:py:func:`~pvlib.iotools.get_nsrdb_psm4_aggregated`,
2828
:py:func:`~pvlib.iotools.get_nsrdb_psm4_tmy`,
2929
:py:func:`~pvlib.iotools.get_nsrdb_psm4_conus`,
30-
:py:func:`~pvlib.iotools.get_nsrdb_psm4_full_disc`,
31-
:py:func:`~pvlib.iotools.read_nsrdb_psm4`, and
32-
:py:func:`~pvlib.iotools.parse_nsrdb_psm4`. (:issue:`2326`, :pull:`2378`)
30+
:py:func:`~pvlib.iotools.get_nsrdb_psm4_full_disc`, and
31+
:py:func:`~pvlib.iotools.read_nsrdb_psm4`. (:issue:`2326`, :pull:`2378`, :pull:`2445`)
32+
* :py:mod:`pvlib.bifacial.infinite_sheds` no longer emits "invalid value" warnings
33+
when supplying irradiance arrays with nighttime zero values. (:issue:`2450`, :pull:`2451`)
3334
* Add ``'semi_integrated'`` parameters for the PVsyst temperature model.
3435
(:issue:`2330`, :pull:`2415`)
3536

pvlib/bifacial/infinite_sheds.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@
99
from pvlib.irradiance import beam_component, aoi, haydavies
1010

1111

12-
def _poa_ground_shadows(poa_ground, f_gnd_beam, df, vf_gnd_sky):
12+
def _poa_ground_shadows(ghi, dhi, albedo, f_gnd_beam, vf_gnd_sky):
1313
"""
1414
Reduce ground-reflected irradiance to the tilted plane (poa_ground) to
1515
account for shadows on the ground.
1616
1717
Parameters
1818
----------
19-
poa_ground : numeric
20-
Ground reflected irradiance on the tilted surface, assuming full GHI
21-
illumination on all of the ground. [W/m^2]
19+
ghi : numeric
20+
Global horizontal irradiance, with no adjustments. [W/m^2]
21+
dhi : numeric
22+
Diffuse horizontal irradiance, with no adjustments. [W/m^2]
23+
albedo : numeric
24+
Ground albedo, the ratio of reflected to incident irradiance of the
25+
ground surface. [W/m^2]
2226
f_gnd_beam : numeric
2327
Fraction of the distance between rows that is illuminated (unshaded).
2428
[unitless]
25-
df : numeric
26-
Diffuse fraction, the ratio of DHI to GHI. [unitless]
2729
vf_gnd_sky : numeric
2830
View factor from the ground to the sky, integrated along the distance
2931
between rows. [unitless]
@@ -35,7 +37,7 @@ def _poa_ground_shadows(poa_ground, f_gnd_beam, df, vf_gnd_sky):
3537
ground. [W/m^2]
3638
3739
"""
38-
return poa_ground * (f_gnd_beam*(1 - df) + df*vf_gnd_sky)
40+
return albedo * (f_gnd_beam * (ghi - dhi) + vf_gnd_sky * dhi)
3941

4042

4143
def _poa_sky_diffuse_pv(dhi, gcr, surface_tilt):
@@ -339,18 +341,11 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
339341
# and restricted views
340342
# this is a deviation from [1], because the row to ground view factor
341343
# is accounted for in a different manner
342-
ground_diffuse = ghi * albedo
343-
344-
# diffuse fraction
345-
diffuse_fraction = np.clip(dhi / ghi, 0., 1.)
346-
# make diffuse fraction 0 when ghi is small
347-
diffuse_fraction = np.where(ghi < 0.0001, 0., diffuse_fraction)
348-
349344
# Reduce ground-reflected irradiance because other rows in the array
350345
# block irradiance from reaching the ground.
351346
# [2], Eq. 9
352-
ground_diffuse = _poa_ground_shadows(
353-
ground_diffuse, f_gnd_beam, diffuse_fraction, vf_gnd_sky)
347+
ground_diffuse = _poa_ground_shadows(ghi, dhi, albedo, f_gnd_beam,
348+
vf_gnd_sky)
354349

355350
# Ground-reflected irradiance on the row surface accounting for
356351
# the view to the ground. This deviates from [1], Eq. 10, 11 and

pvlib/iotools/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from pvlib.iotools.psm4 import get_nsrdb_psm4_conus # noqa: F401
1717
from pvlib.iotools.psm4 import get_nsrdb_psm4_full_disc # noqa: F401
1818
from pvlib.iotools.psm4 import read_nsrdb_psm4 # noqa: F401
19-
from pvlib.iotools.psm4 import parse_nsrdb_psm4 # noqa: F401
2019
from pvlib.iotools.pvgis import get_pvgis_tmy, read_pvgis_tmy # noqa: F401
2120
from pvlib.iotools.pvgis import read_pvgis_hourly # noqa: F401
2221
from pvlib.iotools.pvgis import get_pvgis_hourly # noqa: F401

0 commit comments

Comments
 (0)