improved empower calculation of drive length
This commit is contained in:
@@ -31,7 +31,7 @@ import os
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import itertools
|
import itertools
|
||||||
|
import math
|
||||||
from tasks import handle_sendemail_unrecognized
|
from tasks import handle_sendemail_unrecognized
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -460,7 +460,7 @@ def save_workout_database(f2,r,dosmooth=True,workouttype='rower',
|
|||||||
|
|
||||||
# put stroke data in database
|
# put stroke data in database
|
||||||
res = dataprep(row.df,id=w.id,bands=True,
|
res = dataprep(row.df,id=w.id,bands=True,
|
||||||
barchart=True,otwpower=True,empower=True)
|
barchart=True,otwpower=True,empower=True,inboard=inboard)
|
||||||
|
|
||||||
return (w.id,message)
|
return (w.id,message)
|
||||||
|
|
||||||
@@ -892,7 +892,7 @@ def smalldataprep(therows,xparam,yparam1,yparam2):
|
|||||||
# saves it to the stroke_data table in the database
|
# saves it to the stroke_data table in the database
|
||||||
# Takes a rowingdata object's DataFrame as input
|
# Takes a rowingdata object's DataFrame as input
|
||||||
def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
|
def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
|
||||||
empower=True):
|
empower=True,inboard=0.88):
|
||||||
rowdatadf.set_index([range(len(rowdatadf))],inplace=True)
|
rowdatadf.set_index([range(len(rowdatadf))],inplace=True)
|
||||||
t = rowdatadf.ix[:,'TimeStamp (sec)']
|
t = rowdatadf.ix[:,'TimeStamp (sec)']
|
||||||
t = pd.Series(t-rowdatadf.ix[0,'TimeStamp (sec)'])
|
t = pd.Series(t-rowdatadf.ix[0,'TimeStamp (sec)'])
|
||||||
@@ -1005,7 +1005,11 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
|
|||||||
finish = rowdatadf.ix[:,'finish']
|
finish = rowdatadf.ix[:,'finish']
|
||||||
peakforceangle = rowdatadf.ix[:,'peakforceangle']
|
peakforceangle = rowdatadf.ix[:,'peakforceangle']
|
||||||
driveenergy = rowdatadf.ix[:,'driveenergy']
|
driveenergy = rowdatadf.ix[:,'driveenergy']
|
||||||
drivelength = driveenergy/(averageforce*4.44822)
|
arclength = (inboard-0.05)*(np.radians(finish)-np.radians(catch))
|
||||||
|
if arclength.mean()>0:
|
||||||
|
drivelength = arclength
|
||||||
|
else:
|
||||||
|
drivelength = driveenergy/(averageforce*4.44822)
|
||||||
slip = rowdatadf.ix[:,'slip']
|
slip = rowdatadf.ix[:,'slip']
|
||||||
if windowsize > 3 and windowsize<len(slip):
|
if windowsize > 3 and windowsize<len(slip):
|
||||||
wash = savgol_filter(wash,windowsize,3)
|
wash = savgol_filter(wash,windowsize,3)
|
||||||
|
|||||||
Reference in New Issue
Block a user