small improvement coordinates
This commit is contained in:
@@ -53,7 +53,7 @@ class FlexibleDecimalField(forms.DecimalField):
|
|||||||
|
|
||||||
# Video Analysis creation form
|
# Video Analysis creation form
|
||||||
class VideoAnalysisCreateForm(forms.Form):
|
class VideoAnalysisCreateForm(forms.Form):
|
||||||
name = forms.CharField(max_length=255,label='')
|
name = forms.CharField(max_length=255,label='Analysis Name')
|
||||||
url = forms.CharField(max_length=255,required=True,label='YouTube Video URL')
|
url = forms.CharField(max_length=255,required=True,label='YouTube Video URL')
|
||||||
delay = forms.IntegerField(initial=0,label='Delay (seconds)')
|
delay = forms.IntegerField(initial=0,label='Delay (seconds)')
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,11 @@
|
|||||||
<i class="fas fa-map-marked-alt fa-fw"></i> Map
|
<i class="fas fa-map-marked-alt fa-fw"></i> Map
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li id="video-analysis">
|
||||||
|
<a href="/rowers/workout/{{ workout.id|encode }}/video/">
|
||||||
|
<i class="fas fa-video-plus fa-fw"></i> Video Analysis
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li id="chart-empower">
|
<li id="chart-empower">
|
||||||
<a href="/rowers/workout/{{ workout.id|encode }}/forcecurve/">
|
<a href="/rowers/workout/{{ workout.id|encode }}/forcecurve/">
|
||||||
<i class="fas fa-dumbbell fa-fw"></i> Force Curve
|
<i class="fas fa-dumbbell fa-fw"></i> Force Curve
|
||||||
|
|||||||
@@ -88,11 +88,12 @@ def workout_video_view(request,id=0):
|
|||||||
spm = (10*df2['spm']).astype(int)/10.
|
spm = (10*df2['spm']).astype(int)/10.
|
||||||
|
|
||||||
coordinates = dataprep.get_latlon_time(w.id)
|
coordinates = dataprep.get_latlon_time(w.id)
|
||||||
|
|
||||||
|
coordinates.set_index(pd.to_timedelta(coordinates['time'],unit='s'),inplace=True)
|
||||||
|
coordinates = coordinates.resample('1s').mean().interpolate()
|
||||||
mask = coordinates['time'] < delay
|
mask = coordinates['time'] < delay
|
||||||
coordinates = coordinates.mask(mask).dropna()
|
coordinates = coordinates.mask(mask).dropna()
|
||||||
coordinates['time'] = coordinates['time']-coordinates['time'].min()
|
coordinates['time'] = coordinates['time']-coordinates['time'].min()
|
||||||
coordinates.set_index(pd.to_timedelta(coordinates['time'],unit='s'),inplace=True)
|
|
||||||
coordinates = coordinates.resample('1s').mean().interpolate()
|
|
||||||
latitude = coordinates['latitude']
|
latitude = coordinates['latitude']
|
||||||
longitude = coordinates['longitude']
|
longitude = coordinates['longitude']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user