Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if system_size is None:
renorm = True
system_size = 1.0
else:
renorm = False
pvwatts_kws = {
"poa_global": poa,
"P_ref": system_size,
"T_cell": sensor_cell_temperature,
"G_ref": g_ref,
"T_ref": t_ref,
"gamma_pdc": gamma_pdc
}
normalized, insolation = normalization.normalize_with_pvwatts(
pv_energy, pvwatts_kws
)
if renorm:
# Normalize to the 95th percentile for convenience;
# this is renormalized out in the calculations but is relevant
# to normalized_filter()
x = normalized[np.isfinite(normalized)]
normalized = normalized / x.quantile(0.95)
return normalized, insolation