You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Set negative values of AOI loss to 0 rather than np.nan #338
The current AOI loss models set negative values to np.nan, rather than zero. When np.nans are propagated to the effective irradiance model, the beam irradiance (and the effective irradiance) becomes np.nan rather than 0. As a consequence, pvlib cannot compute effective irradiance when AOI>90, i.e., when the sun is behind the array plane. In this circumstance there's still diffuse irradiance on the array plane.
I think it would be better to implement the AOI loss models as
f(AOI) = model value if AOI<90
f(AOI) = 0 otherwise.
I can see arguments for nans or 0s. I think nan could be the right result because maybe it doesn't make sense to talk about an AOI modifier when the sun is behind the array plane. In a similar fashion, pvlib's relative airmass function returns nan when the zenith angle is greater than 90.
On the other hand, I can think of at least a few of my results where I've failed to account for these nans, so that's a good indicator that something should change.
One thing is for certain: ModelChain fails to account for the nans in its effective_irradiance calculation and that should be fixed as soon as possible.
I am in favour of having having all the iam functions return a value of zero or greater for any angle, except maybe an angle that is nan.
It appears that currently the comments for physicaliam don't correspond to the code, and furthermore, each of the three available iam models has slightly different constraints.
Activity
jkfm commentedon Jun 13, 2017
Thanks Cliff for opening an issue! It refers to my question in the google group.
If I find time in the next couple of days, and if there is consent on the issue, I will start working on a pull request.
cwhanse commentedon Jun 13, 2017
wholmgren commentedon Jun 13, 2017
I can see arguments for nans or 0s. I think nan could be the right result because maybe it doesn't make sense to talk about an AOI modifier when the sun is behind the array plane. In a similar fashion, pvlib's relative airmass function returns nan when the zenith angle is greater than 90.
On the other hand, I can think of at least a few of my results where I've failed to account for these nans, so that's a good indicator that something should change.
One thing is for certain: ModelChain fails to account for the nans in its effective_irradiance calculation and that should be fixed as soon as possible.
adriesse commentedon Jun 13, 2017
I am in favour of having having all the iam functions return a value of zero or greater for any angle, except maybe an angle that is nan.
It appears that currently the comments for physicaliam don't correspond to the code, and furthermore, each of the three available iam models has slightly different constraints.
wholmgren commentedon Jun 14, 2017
The code below should allow you to monkey patch your modelchain objects until we get this fixed:
AC power without the patch:
and with the patch:
jkfm commentedon Jun 14, 2017
Thanks for the fix, @wholmgren. I forked the project and changed the functions for myself though (see PR).
Incidence Angle Modifier zero instead of np.nan (#338) (#339)
wholmgren commentedon Aug 1, 2017
closed by #339