reduced calculational complexity otwcp
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user