Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improbable value for average speed #55

Open
MihaMi27 opened this issue Dec 6, 2024 · 0 comments
Open

Improbable value for average speed #55

MihaMi27 opened this issue Dec 6, 2024 · 0 comments

Comments

@MihaMi27
Copy link

MihaMi27 commented Dec 6, 2024

Description

During parsing of a specific TCX file (3065.tcx, attached below, taken from Sport5, folder 1 I got a weird value for average speed. I've attached screenshots and code for my comparison between average speeds from TCXReader library and sport-activities-features library.

image
As you can see the marked values for total distance and average speed are different between both approaches. Other values seem fine.

However, if it is relevant here, both differ from the average and maximum speeds in the file.
image

File

3065.tcx.zip

Code

Code I've used for testing:

from sport_activities_features import TCXFile
import numpy as np
from tcxreader.tcxreader import TCXReader,TCXExercise

tcx_exercise: TCXExercise = TCXReader().read('3065.tcx')

tcx_file = TCXFile()
activity = tcx_file.read_one_file('3065.tcx',True)


print("SportActivitiesFeatures:")
print("Average speed: ",np.mean(activity['speeds']))
print("Max speed:",np.max(activity['speeds']))
print("Total distance:",np.sum(activity['distances']))
print("Delta Time:",activity['timestamps'][-1]-activity['timestamps'][0])
print("Average altitude:",np.mean(activity['altitudes']))
print("Max altitude:",np.max(activity['altitudes']))
print("Min altitude:",np.min(activity['altitudes']))
print("Average altitude:",np.mean(activity['heartrates']))
print("Max altitude:",np.max(activity['heartrates']))
print("Min altitude:",np.min(activity['heartrates']))
print()
print("TCXReader:")
print("Average speed: ",tcx_exercise.avg_speed)
print("Max speed:",tcx_exercise.max_speed)
print("Total distance:",tcx_exercise.distance)
print("Delta Time:",tcx_exercise.duration)
print("Average altitude:",tcx_exercise.altitude_avg)
print("Max altitude:",tcx_exercise.altitude_max)
print("Min altitude:",tcx_exercise.altitude_min)
print("Average Heart Rate:",tcx_exercise.hr_avg)
print("Max Heart Rate:",tcx_exercise.hr_max)
print("Min Heart Rate:",tcx_exercise.hr_min)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant