From d8909aebc07b8abb074ff363281ca148dcdb855e Mon Sep 17 00:00:00 2001 From: Michael Deceglie Date: Wed, 4 Sep 2019 15:21:12 -0600 Subject: [PATCH] renormalization bug fix --- rdtools/system_analysis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rdtools/system_analysis.py b/rdtools/system_analysis.py index bbf38091..45f6b6e9 100644 --- a/rdtools/system_analysis.py +++ b/rdtools/system_analysis.py @@ -3,6 +3,7 @@ ''' import pvlib import pandas as pd +import numpy as np import matplotlib.pyplot as plt from . import normalization from . import filtering @@ -41,7 +42,7 @@ class system_analysis(): frequency of the data, rather than up or down sampling. Analysis requires regular time series. max_timedelta: The maximum gap in the data to be interpolated/integrated across when interpolating or calculating energy from power (Timedelta) ''' - + def __init__(self, pv, poa=None, temperature=None, temperature_coefficient=None, aggregation_freq='D', pv_input='power', temperature_input='cell', pvlib_location=None, clearsky_poa=None, clearsky_temperature=None, clearsky_temperature_input='cell', windspeed=0, albedo=0.25, @@ -215,7 +216,8 @@ def pvwatts_norm(self, poa, cell_temperature): if renorm: # Normalize to the 95th percentile for convenience, this is renormalized out # in the calculations but is relevant to normalized_filter() - normalized = normalized / normalized.quantile(0.95) + x = normalized[np.isfinite(normalized)] + normalized = normalized / x.quantile(0.95) return normalized, insolation