Is there a way to extract the kilojoules spent during a ride from a fit file? From what I can tell the FIT_RECORD_MESG has a calories field though no sure how / if this relates to kilojoules?
Is there a way to extract the kilojoules spent during a ride from a fit file? From what I can tell the FIT_RECORD_MESG has a calories field though no sure how / if this relates to kilojoules?
The calculation for kilojoules looks like this:
1 Joule = 1 Watt * 1 Second
Joules = Avg Watts * Duration in Seconds
Kilojoules = Joules / 1000
In the session message are the average power and total timer time values. Don't use total elapsed time. You can use those values as the inputs for the above calculation.
Looking at the values I get from that calculation, it's closer to what's shown as calories in the Garmin Connect iOS app. Is there something I'm missing here in my understanding of the difference between joules and calories?
For most people kJs and calories can be used interchangeably. A back of the napkin calculation would be that 1 Calorie equals ~4kJs. But the human body is only around 25% efficient. So what you get is a formula that looks like this: (1cal / 4kJ) * 0.25 = 1.
If you ask a sports physiologist they will tell you that 1 Calorie equals 4.184kJs, but they will probably also tell you that you are less than 25% efficient, and you are back to something that looks like a 1:1 ratio anyways.
To get an accurate Calorie estimation from heat-rate data you need to have your user profile and activity class setup correctly. But even then there are things like hydration, sleep, temperature (core and ambient), being sick, etc. that will affect your heart-rate which will in turn affect your Calorie data.
Whereas watts are watts, which makes the kJ value a better indication of the work done.