added Rhythm to flex plot
This commit is contained in:
@@ -478,6 +478,7 @@ def read_cols_df_sql(ids,columns):
|
||||
|
||||
connection = engine.raw_connection()
|
||||
df = pd.read_sql_query(query,engine)
|
||||
df = df.fillna(value=0)
|
||||
engine.dispose()
|
||||
return df
|
||||
|
||||
@@ -489,6 +490,7 @@ def read_df_sql(id):
|
||||
id=id)), engine)
|
||||
|
||||
engine.dispose()
|
||||
df = df.fillna(value=0)
|
||||
return df
|
||||
|
||||
# Get the necessary data from the strokedata table in the DB.
|
||||
@@ -562,7 +564,15 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
|
||||
|
||||
forceratio = averageforce/peakforce
|
||||
forceratio = forceratio.fillna(value=0)
|
||||
|
||||
|
||||
try:
|
||||
drivetime = rowdatadf.ix[:,' DriveTime (ms)']
|
||||
recoverytime = rowdatadf.ix[:,' StrokeRecoveryTime (ms)']
|
||||
rhythm = 100.*drivetime/(recoverytime+drivetime)
|
||||
rhythm = rhythm.fillna(value=0)
|
||||
except:
|
||||
rhythm = 0.0*forceratio
|
||||
|
||||
f = rowdatadf['TimeStamp (sec)'].diff().mean()
|
||||
windowsize = 2*(int(10./(f)))+1
|
||||
if windowsize <= 3:
|
||||
@@ -612,6 +622,7 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
|
||||
forceratio=forceratio,
|
||||
distance=distance,
|
||||
drivespeed=drivespeed,
|
||||
rhythm=rhythm,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user