fixing resample issue
This commit is contained in:
@@ -374,6 +374,18 @@ def workout_summary_to_df(
|
||||
|
||||
def resample(id, r, parent, overwrite=False):
|
||||
data, row = getrowdata_db(id=id)
|
||||
rowdata = rrdata(csvfile=parent.csvfilename).df
|
||||
# drop all columns except ' latitude' and ' longitude' and 'TimeStamp (sec)' from rowdata
|
||||
allowedcolumns = [' latitude', ' longitude', 'TimeStamp (sec)']
|
||||
rowdata = rowdata.filter(allowedcolumns)
|
||||
rowdata.rename(columns={'TimeStamp (sec)': 'time'}, inplace=True)
|
||||
rowdata['time'] = (rowdata['time']-rowdata.loc[0,'time'])*1000.
|
||||
rowdata.set_index('time', inplace=True)
|
||||
data.set_index('time', inplace=True)
|
||||
rowdata_interpolated = rowdata.reindex(data.index.union(rowdata.index)).interpolate('index')
|
||||
data = data.merge(rowdata_interpolated, left_index=True, right_index=True, how='left')
|
||||
data = data.reset_index()
|
||||
|
||||
messages = []
|
||||
|
||||
# resample
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -4700,6 +4700,7 @@ def workout_map_view(request, id=0):
|
||||
u = w.user.user
|
||||
r = getrower(u)
|
||||
rowdata = rdata(csvfile=f1)
|
||||
|
||||
hascoordinates = 1
|
||||
if rowdata != 0:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user