Private
Public Access
1
0

reduced calculational complexity otwcp

This commit is contained in:
Sander Roosendaal
2017-06-10 21:19:00 -04:00
parent 87cfe1d3d8
commit bd7b003280

View File

@@ -2905,7 +2905,7 @@ def otwrankings_view(request,theuser=0,
maxlog10 = np.log10(maxt)
logarr = np.arange(100)*maxlog10/100.
logarr = np.arange(50)*maxlog10/50.
logarr = [int(10.**(la)) for la in logarr]
logarr = pd.Series(logarr)
logarr.drop_duplicates(keep='first',inplace=True)
@@ -2923,6 +2923,18 @@ def otwrankings_view(request,theuser=0,
tt = group['time'].copy()
ww = group['power'].copy()
tmax = tt.max()
newlen = int(tmax/2000.)
print newlen,len(ww)
newt = np.arange(newlen)*tmax/float(newlen)
neww = griddata(tt.values,
ww.values,
newt,method='linear',
rescale=True)
#tt = pd.Series(newt)
#ww = pd.Series(neww)
try:
avgpower[id] = int(ww.mean())
except ValueError: