There was an enquiry about calculating SWOLF for swims. I did a bit of googling and it seems SWOLF is calculated per 25m (strokes + seconds). So for the whole activity the SWOLF calculation looks like this:
{
let strokesPerSec = activity.average_cadence / 60
let strokes = activity.moving_time * strokesPerSec
let swolf = (strokes + activity.moving_time) * 25 / activity.icu_distance
swolf
}
I have added public custom activity and interval SWOLF fields using this calculation. You can search for SWOLF:
Hi David,
Thank you for SWOLF. This method is generally ok, but it’s not accurate. It’s because average cadence per second rounding. The difference between real SWOLF and the code above is not so huge (2-3%) but in swimming it makes game change - just like bike power meters
This could be perfectly solved by extracting total_strokes from fit file:
SWOLF = (activity.total_strokes + acivity.moving_time) / activity_lengths * (25 / activity.pool_length)
This method also incudes normalized pool lenght. Sometimes swim session are in 20m or 50m pool lenght, so there need to be normalization to 25m at the end.
Unfortunately total_strokes is on the length records in the file I looked at (your swim from 9th Feb). What I don’t understand is how swimming cadence is calculated. One of your lengths from that swim:
Ok, figured out.
it’s like Garmin cadence “Zero averaging” cadence feature set to OFF.
So when you flip at the end of each pool length, you are starting first stroke after some seconds after underwater, and then starts strokes. so average strokes not including those uderwater zeros.
It would be nice if this was also a chart shown on the activity. I also have some swim activities (likely the ones including drills) where this current value doesn’t populate.