sort of works
This commit is contained in:
@@ -1030,8 +1030,6 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
|
|||||||
|
|
||||||
p2 = p.fillna(method='ffill').apply(lambda x: timedeltaconv(x))
|
p2 = p.fillna(method='ffill').apply(lambda x: timedeltaconv(x))
|
||||||
|
|
||||||
print p
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
drivespeed = drivelength/rowdatadf[' DriveTime (ms)']*1.0e3
|
drivespeed = drivelength/rowdatadf[' DriveTime (ms)']*1.0e3
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
@@ -148,10 +148,6 @@ def get_strava_workout_list(user):
|
|||||||
def add_stroke_data(user,stravaid,workoutid,startdatetime,csvfilename):
|
def add_stroke_data(user,stravaid,workoutid,startdatetime,csvfilename):
|
||||||
r = Rower.objects.get(user=user)
|
r = Rower.objects.get(user=user)
|
||||||
|
|
||||||
print 'Queueing job for workout {workoutid} (strava {stravaid})'.format(
|
|
||||||
workoutid=workoutid,
|
|
||||||
stravaid=stravaid)
|
|
||||||
|
|
||||||
starttimeunix = arrow.get(startdatetime).timestamp
|
starttimeunix = arrow.get(startdatetime).timestamp
|
||||||
|
|
||||||
job = myqueue(queue,
|
job = myqueue(queue,
|
||||||
@@ -184,7 +180,7 @@ def get_strava_workouts(rower):
|
|||||||
])
|
])
|
||||||
newids = [stravaid for stravaid in stravaids if not stravaid in knownstravaids]
|
newids = [stravaid for stravaid in stravaids if not stravaid in knownstravaids]
|
||||||
|
|
||||||
for stravaid in newids[:1]:
|
for stravaid in newids:
|
||||||
workoutid = create_async_workout(alldata,rower.user,stravaid)
|
workoutid = create_async_workout(alldata,rower.user,stravaid)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -167,15 +167,15 @@ def handle_strava_import_stroke_data(stravatoken,
|
|||||||
nr_strokes = len(t)
|
nr_strokes = len(t)
|
||||||
|
|
||||||
df = pd.DataFrame({'TimeStamp (sec)':unixtime,
|
df = pd.DataFrame({'TimeStamp (sec)':unixtime,
|
||||||
' ElapsedTime (sec)':10*t,
|
' ElapsedTime (sec)':t,
|
||||||
' Horizontal (meters)':10*d,
|
' Horizontal (meters)':d,
|
||||||
' Stroke500mPace (sec/500m)':10*pace,
|
' Stroke500mPace (sec/500m)':pace,
|
||||||
' Cadence (stokes/min)':spm,
|
' Cadence (stokes/min)':spm,
|
||||||
' HRCur (bpm)':hr,
|
' HRCur (bpm)':hr,
|
||||||
' latitude':lat,
|
' latitude':lat,
|
||||||
' longitude':lon,
|
' longitude':lon,
|
||||||
' StrokeDistance (meters)':strokelength,
|
' StrokeDistance (meters)':strokelength,
|
||||||
'cum_dist':10*d,
|
'cum_dist':d,
|
||||||
' DragFactor':np.zeros(nr_strokes),
|
' DragFactor':np.zeros(nr_strokes),
|
||||||
' DriveLength (meters)':np.zeros(nr_strokes),
|
' DriveLength (meters)':np.zeros(nr_strokes),
|
||||||
' StrokeDistance (meters)':np.zeros(nr_strokes),
|
' StrokeDistance (meters)':np.zeros(nr_strokes),
|
||||||
|
|||||||
Reference in New Issue
Block a user