Private
Public Access
1
0

Improved Smoothing

This commit is contained in:
Sander Roosendaal
2016-11-13 11:55:15 +01:00
parent 780c1f9611
commit ae0d95ecb5
2 changed files with 27 additions and 7 deletions

View File

@@ -402,8 +402,12 @@ def add_workout_from_strokedata(user,importid,data,strokedata,source='c2'):
velo2 = savgol_filter(velo,windowsize,3)
else:
velo2=velo
velo3 = pd.Series(velo2)
velo3 = velo3.replace([-np.inf,np.inf],np.nan)
velo3 = velo3.fillna(method='ffill')
pace2 = 500./abs(velo2)
pace2 = 500./abs(velo3)
df[' Stroke500mPace (sec/500m)'] = pace2
df = df.fillna(0)
@@ -630,8 +634,12 @@ def add_workout_from_stdata(user,importid,data):
velo2 = savgol_filter(velo,windowsize,3)
else:
velo2 = velo
velo3 = pd.Series(velo2)
velo3 = velo3.replace([-np.inf,np.inf],np.nan)
velo3 = velo3.fillna(method='ffill')
pace2 = 500./abs(velo2)
pace2 = 500./abs(velo3)
df[' Stroke500mPace (sec/500m)'] = pace2
df = df.fillna(0)
@@ -3404,7 +3412,12 @@ def workout_upload_view(request,message=""):
else:
velo2 = velo
pace2 = 500./abs(velo2)
velo3 = pd.Series(velo2)
velo3 = velo3.replace([-np.inf,np.inf],np.nan)
velo3 = velo3.fillna(method='ffill')
pace2 = 500./abs(velo3)
row.df[' Stroke500mPace (sec/500m)'] = pace2
row.df = row.df.fillna(0)
@@ -3613,8 +3626,6 @@ def workout_upload_view_debug(request,message=""):
f2 = res[1] # file name incl media directory
print fileformat
# handle non-Painsled
if (fileformat != 'csv'):
# handle RowPro: