invalid value
warning when calculating diffuse fraction in infinite_sheds
#2450
Labels
Milestone
When supplying numpy arrays for
ghi
anddhi
that have zeros (e.g. for nighttime), a warning is emitted:We could simply suppress the warning, but I think a better solution is to do away with the calculation entirely. This diffuse fraction is used only in the
_poa_ground_shadows
function, which computes the average irradiance reflected from the ground, accounting for the shadows cast by rows and the restricted ground->sky view factor:pvlib-python/pvlib/bifacial/infinite_sheds.py
Line 38 in 216386e
where
df
is the diffuse fraction andpoa_ground
isghi * albedo
. The math is equivalent to the following:This alternative means we don't need to calculate the diffuse fraction at all, and (to me) is an improvement in clarity as well. I propose dropping
diffuse_fraction
and using the above calculation instead. Note that the line in question is in a private function, so it is no issue to change the relevant function signature.The text was updated successfully, but these errors were encountered: