Private
Public Access
1
0

fix obscure bug

This commit is contained in:
Sander Roosendaal
2020-10-26 20:53:52 +01:00
parent bbd41408da
commit b8cd01c1af
4 changed files with 1472 additions and 16 deletions

View File

@@ -269,22 +269,24 @@ def getcp(dfgrouped,logarr):
mask = ww > 2000
ww.loc[mask] = 0
tmax = tt.max()
if tmax > 500000:
newlen = int(tmax/2000.)
else:
newlen = len(tt)
if newlen < len(tt):
newt = np.arange(newlen)*tmax/float(newlen)
ww = griddata(tt.values,
ww.values,
newt,method='linear',
rescale=True)
tt = pd.Series(newt)
ww = pd.Series(ww)
# if tmax > 3600000:
# newlen = int(tmax/10000.)
# else:
# newlen = len(tt)
# if newlen < len(tt):
# newt = np.arange(newlen)*tmax/float(newlen)
# ww = griddata(tt.values,
# ww.values,
# newt,method='nearest',
# rescale=True)
#
# tt = pd.Series(newt)
# ww = pd.Series(ww)
try:
@@ -303,7 +305,6 @@ def getcp(dfgrouped,logarr):
cpw.append(wmax)
dt = pd.Series(dt)
cpw = pd.Series(cpw)
if len(dt)>2:
@@ -346,7 +347,7 @@ def getmaxwattinterval(tt,ww,i):
t_0 = tt.loc[indexmaxpos]
t_1 = tt.loc[indexmaxpos-i]
deltas = tt.loc[indexmaxpos-i:indexmaxpos].diff().dropna()
testres = 1.0e-3*deltas.max() < 30.
testres = 1.0e-3*deltas.max() < 30. and not deltas.isnull().values.any()
if testres:
deltat = 1.0e-3*(t_0-t_1)
wmax = w_roll.loc[indexmaxpos]