Private
Public Access
1
0

empower fix done

This commit is contained in:
Sander Roosendaal
2018-05-02 14:20:20 +02:00
parent 379626f802
commit 5920774197
6 changed files with 365 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ from rowingdata import rowingdata as rrdata
from rowingdata import make_cumvalues
from rowingdata import rower as rrower
from rowingdata import main as rmain
from rowingdata import empower_bug_correction,get_empower_rigging
from time import strftime
from pandas import DataFrame,Series
@@ -659,7 +660,55 @@ def update_strokedata(id,df,debug=False):
debug=debug)
return rowdata
def update_empower(id, inboard, oarlength, boattype, df, f1, debug=False):
corr_factor = 1.0
if 'x' in boattype:
# sweep
a = 0.06
b = 0.275
else:
# scull
a = 0.15
b = 0.275
corr_factor = empower_bug_correction(oarlength,inboard,a,b)
success = False
print df[' Power (watts)'].mean()
try:
df['power empower old'] = df[' Power (watts)']
df[' Power (watts)'] = df[' Power (watts)'] * corr_factor
df['driveenergy empower old'] = df['driveenergy']
df['driveenergy'] = df['driveenergy'] * corr_factor
success = True
except KeyError:
pass
if success:
delete_strokedata(id,debug=debug)
if debug:
print "updated ",id
print "correction ",corr_factor
else:
if debug:
print "not updated ",id
print df[' Power (watts)'].mean()
rowdata = dataprep(df,id=id,bands=True,barchart=True,otwpower=True,
debug=debug)
row = rrdata(df=df)
row.write_csv(f1,gzip=True)
return success
def testdata(time,distance,pace,spm):
t1 = np.issubdtype(time,np.number)
t2 = np.issubdtype(distance,np.number)