Custom interval fields

I have made custom fields called “Running time” and “Running time %”, similar to the run/walk detection in Garmin. Thought some of you might like it :slight_smile:

There are fields both for the activity as a whole, and for each interval.

Here’s what it looks like:

It defines running as anything over a 60 cadence, and walking as anything over a 10 cadence. It will also ignore any data during the warmup and cooldown periods defined for your running activity.

The running time calculated is usually a little lower than the one shown by Garmin - not sure why but its usually <1m of difference.

2 Likes

@david I’m trying to extract Stryd average Vertical Oscillation out of fit file data for my intervals and have been unsuccessful so far. Any advice?

You will be able to do that when I finally find time to complete support for mapping custom fields from records to activity traces. You will need to create a trace for it and then a custom activity/interval field to calculate the average.

Dear all,
I am trying to add an interval field which should be apparently pretty simple:
(Work above FTP/Total Work*100) > its simply the percentage of W>FTP to the Wtot for that interval.

I have found the “joules_above_ftp Integer” on the script page, but I must confess, my scripting-skills are pretty poor :worried:
Any help is much appreciated.

thanks
alfred

@david:
brief question to your “All Work >FTP” field:
it is described as “…This measure includes the below the line portion when operating at or above FTP.”

Does this mean that power AT FTP is also accounted for (i.e. FTP 250W > the script also calculates when working at 250W and not starts at 251W as the Work>FTP would do?).
And what means “…below the line portion…”? Does it also calculate 249 or 248, which is, by definition below FTP. Is there any trade-off in the script (e.g. if power is below FTP for xxx seconds > then calculate > else not).

Sorry for my simplified coding language, hope the question is clear enough.

best
alfred

There are 2 possibilities:

  • You only take the Work that has been done at or above FTP and only that portion
  • You take all Work done when intensity is equal or above FTP

The script does “if (w >= ftp) {” so yes work done at FTP counts. I think this script will do:

{
interval.joules_above_ftp * 100 / interval.joules
}

thank you David, script works as required, and also @MedTechCD for stepping in.

re to (w>=ftp): this makes a significant difference compared to (w>ftp), in the example below 35 vs 215kJ

image

Have to reconsider on whether 1Watt up or down can make such a difference. But then again over 3h…

cheers
alfred

hi again, sorry a little too late yesterday evening to think clear :sleeping:
Soon became clear afterwards that “All Work>FTP” calculate ALL power*t, whereas “W>FTP” use the typical Wbal calculation where W=(P-FTP)*t.
The former is obviously much higher.

cheers
alfred

That’s what I wanted to point out with this remark :wink:

yes, with hindsight it is clear and thank you for this. As an advocate for the CP-concept I haven’t considered to use all work at first sight…

Hello!

I’m playing with a custom interval field that calculates the % of power related to ftp
this is the script (that doesn’t work :smiley: )

power=interval.power_average
ftp=activity.icu_ftp

(power/ftp)*100

Somebody can help me?

thanks a lot!

Here you go:

{
  interval.average_watts * 100 / activity.icu_ftp
}
1 Like

Hi all

I like the feature to have custom fields - great!!
Unfortunately I cannot program Java.

I would like to have a field that shows the “total weekly load” divided by the “total weekly training hours”

If anybody could help me with the code - that would be fanatstic!

Cheers Andy

Andy,
if you mean a custom activity field, there is a public activity field (Load/h) you can add to your activities.

Once activated, it shows the metric on top of your activity.

image

If you would like to average, summarise etc. on a customised fitness page, you can do so on a custom chart just like that

was it this what you are after?

cheers
alfred

1 Like

Hey Alfred,

That’s exactly what I was looking for.
Tried it briefly and it seems to work only sometimes.
Some activities show only load/h=?

I try further and let you know.

Cheers
Andy

It seems that you have to „run“ the script manually for each single past activity…

Reanalyze in bulk from the Activities List View to get them all at once.

1 Like

Thanks!! It works

That’s interesting …re-analyze from the activities list works - but not the analyze within the single activity…

This is awesome. Is there a lookup table somewhere for variables (or manual for scripting)? Was able to learn a thing or two from existing scripts, but still struggling. Looking to call ‘Fitness’, ‘FTP’ and ‘Weight’.

Edit: I found the parameters and got the script up and running. It 99% there, but still have one small issue.
The parameter activity.icu_ftp returns either the indoor or outdoor FTP depending on the activity. Would prefer to always call the outdoor FTP, is there a parameter for that?