Private
Public Access
1
0

same basis of logarithmic delta axis

This commit is contained in:
Sander Roosendaal
2020-10-12 08:50:32 +02:00
parent a42c275a09
commit 60a68f5611
2 changed files with 21 additions and 16 deletions

View File

@@ -1034,10 +1034,10 @@ def fetchcp_new(rower,workouts):
except KeyError:
powermean = 0
if powermean != 0:
thesecs = totaltime
maxt = 1.05 * thesecs
if maxt > 0:
logarr = datautils.getlogarr(maxt)
dfgrouped = strokesdf.groupby(['workoutid'])
@@ -1052,6 +1052,8 @@ def fetchcp_new(rower,workouts):
data.append(df)
if len(data) == 0:
return pd.Series(),pd.Series(),0
if len(data)>1:
df = pd.concat(data,axis=0)
@@ -1059,22 +1061,22 @@ def fetchcp_new(rower,workouts):
df = df.sort_values(['delta']).reset_index()
dindex = df['id'].shift(1)-df['id']
dpowerplus = df['cp'].shift(1)-df['cp']
dpowermin = df['cp'].shift(-1)-df['cp']
badrows = []
badid = 0
for index,row in df.iterrows():
if dindex[index] != 0 and dpowermin[index] > 0:
badrows.append(index)
badid = row['id']
elif row['id'] == badid:
badrows.append(index)
else:
badid = 0
#dindex = df['id'].shift(1)-df['id']
#dpowerplus = df['cp'].shift(1)-df['cp']
#dpowermin = df['cp'].shift(-1)-df['cp']
#badrows = []
#badid = 0
#for index,row in df.iterrows():
# if dindex[index] != 0 and dpowermin[index] > 0:
# badrows.append(index)
# badid = row['id']
# elif row['id'] == badid:
# badrows.append(index)
# else:
# badid = 0
df = df.drop(index = badrows)
#df = df.drop(index = badrows)
return df['delta'],df['cp'],0