-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference in TrendAnalysis filtering behavior between power=0 and power=nan #313
Comments
We should be careful about changing answers for users relying on the default behavior. Let's add a kwarg, whose default value triggers a deprecation warning and a suggestion. The preferred option for that kwarg would use some minimum as a threshold for inclusion in the quantile calculations. We'll use the preferred option in updated examples. |
Thinking this through a little more, for the minimum threshold calculation let's first replace all NaN with 0, then use a fraction of a high percentile to set the minimum. |
New plan: address this bug in the examples for now, then implement a more robust but result-changing fix in RdTools 3 |
Changing
TrendAnalysis(pv=power, ...)
toTrendAnalysis(pv=power.replace(0, np.nan), ...)
can change the degradation output. There are at least two differences in behavior betweenpower=0
andpower=np.nan
, both of which occur in the pre-aggregation filtering steps:rdtools.clipping.quantile_clip_filter
the clipping threshold is calculated as the 98th percentile ofpower_ac
. This ignorespower_ac=np.nan
but notpower_ac=0
. Withpower_ac=0
the threshold tends to be lower and the filter excludes more points.TrendAnalysis._pvwatts_norm
,energy_normalized
is optionally renormalized by dividing by its 95th percentile. Times withpv_energy=0
and nonzero irradiance affect this 95th percentile, but times wherepv_energy=np.nan
do not. By changing this renormalization constant, the entirenormalized_energy
series is scaled up or down and points get moved into or out of the allowed range specified inrdtools.filtering.normalized_filter
.Note that the clipping effect applies to any
power=0
while the normalization effect only applies topower=0
during daylight hours (i.e., when expected production is nonzero).Here's a modified version of the PVDAQ4 TrendAnalysis notebook showing how the clipping threshold varies (856 to 819 in this case): https://gist.github.com/kanderso-nrel/ea025bf4ea94397b16865e3fcacd9d88
I don't yet have a good example for the second effect.
Marking this as a bug since it seems to me that both of these are undesirable effects. Thanks @williamhobbs for noticing the difference in output!
The text was updated successfully, but these errors were encountered: