manual workout form - datetime is 48 years off
This commit is contained in:
@@ -555,6 +555,49 @@ def fetchcp(rower,theworkouts,table='cpdata'):
|
||||
return [],[],avgpower2
|
||||
|
||||
|
||||
# create a new workout from manually entered data
|
||||
def create_row_df(distance,duration,startdatetime):
|
||||
|
||||
print startdatetime
|
||||
|
||||
nr_strokes = int(distance/10.)
|
||||
|
||||
unixstarttime = arrow.get(startdatetime).timestamp
|
||||
|
||||
print unixstarttime,'aap'
|
||||
|
||||
totalseconds = duration.hour*3600.
|
||||
totalseconds += duration.minute*60.
|
||||
totalseconds += duration.second
|
||||
totalseconds += duration.microsecond/1.e6
|
||||
|
||||
|
||||
spm = 60.*nr_strokes/totalseconds
|
||||
|
||||
step = totalseconds/float(nr_strokes)
|
||||
|
||||
elapsed = np.arange(0,totalseconds+step,step)
|
||||
|
||||
dstep = distance/float(nr_strokes)
|
||||
|
||||
d = np.arange(0,distance+dstep,dstep)
|
||||
|
||||
unixtime = unixstarttime + elapsed
|
||||
|
||||
print unixtime
|
||||
|
||||
pace = 500.*totalseconds/distance
|
||||
|
||||
df = pd.DataFrame({
|
||||
'TimeStamp (sec)': unixtime,
|
||||
' Horizontal (meters)': d,
|
||||
' Cadence (stokes/min)': spm,
|
||||
' Stroke500mPace (sec/500m)':pace,
|
||||
' ElapsedTime (sec)':elapsed,
|
||||
})
|
||||
|
||||
return df
|
||||
|
||||
# Processes painsled CSV file to database
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user