debugging
This commit is contained in:
@@ -2897,18 +2897,23 @@ def otwrankings_view(request,theuser=0,
|
||||
|
||||
thesecs.append(timesecs)
|
||||
|
||||
|
||||
if len(thesecs) != 0:
|
||||
maxt = pd.Series(thesecs).max()
|
||||
maxt = 2*pd.Series(thesecs).max()
|
||||
else:
|
||||
maxt = 1000.
|
||||
|
||||
|
||||
maxlog10 = np.log10(maxt)
|
||||
logarr = np.arange(100)*maxlog10/100.
|
||||
logarr = np.arange(500)*maxlog10/500.
|
||||
logarr = [int(10.**(la)) for la in logarr]
|
||||
logarr = pd.Series(logarr)
|
||||
logarr.drop_duplicates(keep='first',inplace=True)
|
||||
|
||||
logarr = logarr.values
|
||||
|
||||
|
||||
|
||||
delta = []
|
||||
cpvalue = []
|
||||
avgpower = {}
|
||||
@@ -2934,32 +2939,35 @@ def otwrankings_view(request,theuser=0,
|
||||
t_1 = tt.ix[indexmax-i-2]
|
||||
deltat = 1.0e-3*(t_0-t_1)
|
||||
wmax = w_roll.ix[indexmax]
|
||||
dt.append(deltat)
|
||||
cpw.append(wmax)
|
||||
if not np.isnan(deltat) and not np.isnan(wmax):
|
||||
dt.append(deltat)
|
||||
cpw.append(wmax)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
dt = pd.Series(dt)
|
||||
cpw = pd.Series(cpw)
|
||||
|
||||
cpvalues = griddata(dt.values,
|
||||
cpw.values,
|
||||
logarr,method='linear',fill_value=0)
|
||||
logarr,method='linear',
|
||||
rescale=True)
|
||||
|
||||
for cpv in cpvalues:
|
||||
cpvalue.append(cpv)
|
||||
for d in logarr:
|
||||
delta.append(d)
|
||||
|
||||
print avgpower
|
||||
dt = pd.Series(delta,name='Delta')
|
||||
delta = pd.Series(delta,name='Delta')
|
||||
cpvalue = pd.Series(cpvalue,name='CP')
|
||||
|
||||
|
||||
powerdf = pd.DataFrame({
|
||||
'Delta':delta,
|
||||
'CP':cpvalue,
|
||||
})
|
||||
|
||||
|
||||
powerdf = powerdf[powerdf['CP']>0]
|
||||
powerdf.dropna(axis=0,inplace=True)
|
||||
powerdf.sort_values(['Delta','CP'],ascending=[1,0],inplace=True)
|
||||
|
||||
Reference in New Issue
Block a user