video bug fix
This commit is contained in:
@@ -133,12 +133,17 @@ def get_video_data(w,groups=['basic'],mode='water'):
|
||||
columns = list(set(columns))
|
||||
df = getsmallrowdata_db(columns,ids=[w.id],
|
||||
workstrokesonly=False,doclean=False,compute=False)
|
||||
|
||||
|
||||
df['time'] = (df['time']-df['time'].min())/1000.
|
||||
|
||||
df.sort_values(by='time',inplace=True)
|
||||
|
||||
|
||||
df.set_index(pd.to_timedelta(df['time'],unit='s'),inplace=True)
|
||||
df2 = df.resample('1s').first().fillna(method='ffill')
|
||||
df2['time'] = df2.index.total_seconds()
|
||||
|
||||
if 'pace' in columns:
|
||||
df2['pace'] = df2['pace']/1000.
|
||||
p = df2['pace']
|
||||
@@ -177,6 +182,8 @@ def get_video_data(w,groups=['basic'],mode='water'):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# bundle data
|
||||
data = {
|
||||
'boatspeed':boatspeed.values.tolist(),
|
||||
@@ -297,7 +304,7 @@ def get_latlon_time(id):
|
||||
return pd.DataFrame()
|
||||
|
||||
df = pd.DataFrame({
|
||||
'time': rowdata.df[' ElapsedTime (sec)'],
|
||||
'time': rowdata.df['TimeStamp (sec)']-rowdata.df['TimeStamp (sec)'].min(),
|
||||
'latitude': rowdata.df[' latitude'],
|
||||
'longitude': rowdata.df[' longitude']
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user