Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2019-03-07 14:27:40 +01:00
parent 9f73e37297
commit f53a2a22ee
5 changed files with 38 additions and 18 deletions

View File

@@ -415,9 +415,9 @@ def createc2workoutdata(w):
p = np.clip(p,0,3600)
if w.workouttype == 'bike':
p = 2.0*p
t = t.astype(int)
d = d.astype(int)
p = p.astype(int)
# t = t.astype(int)
# d = d.astype(int)
# p = p.astype(int)
spm = row.df[' Cadence (stokes/min)'].astype(int)
spm[0] = spm[1]
try:
@@ -425,12 +425,19 @@ def createc2workoutdata(w):
except ValueError:
hr = 0*d
stroke_data = []
t = t.tolist()
d = d.tolist()
p = p.tolist()
spm = spm.tolist()
hr = hr.tolist()
for i in range(len(t)):
thisrecord = {"t":t[i].astype(int),
"d":d[i].astype(int),
"p":p[i].astype(int),
"spm":spm[i].astype(int),
"hr":hr[i].astype(int)}
thisrecord = {"t":t[i],
"d":d[i],
"p":p[i],
"spm":spm[i],
"hr":hr[i]}
stroke_data.append(thisrecord)
try:

View File

@@ -463,10 +463,15 @@ def add_team_session(t,ps):
return 1
def add_rower_session(r,ps):
ps.rower.add(r)
ps.save()
teams = Team.objects.filter(manager=ps.manager)
members = Rower.objects.filter(team__in=teams).distinct()
if r in members:
ps.rower.add(r)
ps.save()
return 1
return 1
return 0
def remove_team_session(t,ps):
ps.team.remove(t)

View File

@@ -172,6 +172,14 @@ def createsporttracksworkoutdata(w):
distancedata = []
powerdata = []
t = t.tolist()
hr = hr.tolist()
d = d.tolist()
spm = spm.tolist()
lat = lat.tolist()
lon = lon.tolist()
power = power.tolist()
for i in range(len(t)):
hrdata.append(t[i])
hrdata.append(hr[i])

Binary file not shown.

View File

@@ -127,23 +127,23 @@ def createunderarmourworkoutdata(w):
d = row.df.loc[:,'cum_dist'].values
d[0] = d[1]
t = t.astype(float)
t = t.astype(float).tolist()
d = d.astype(int)
spm = row.df[' Cadence (stokes/min)'].astype(int)
d = d.astype(int).tolist()
spm = row.df[' Cadence (stokes/min)'].astype(int).tolist()
spm[0] = spm[1]
hr = row.df[' HRCur (bpm)'].astype(int)
hr = row.df[' HRCur (bpm)'].astype(int).tolist()
speed = row.df[' AverageBoatSpeed (m/s)']
speed = speed.replace(np.inf,0)
speed = speed.replace(np.inf,0).tolist()
haslatlon=1
try:
lat = row.df[' latitude']
lon = row.df[' longitude']
lat = row.df[' latitude'].tolist()
lon = row.df[' longitude'].tolist()
if not lat.std() and not lon.std():
haslatlon = 0
except KeyError: