Stryd and user defined metric

196 views
Skip to first unread message

Andrea Sabba

unread,
Jan 11, 2025, 4:21:43 PM1/11/25
to golden-cheetah-users

I use Stryd for running, not with Stryd Zones but with the "pbRUN Power" app. I defined a metric called RSS, which represents the TSS for the run, that works with Stryd Zones app:


{

relevant {(isRun) && Data contains "P"; }

value { 0.03 * Duration * IF^3.5; }

count { Duration; }

}

The file fit generated by Forerunner 965 + "pbRUN Power" app, instead, once imported in GC, it conteins the power data into the XDATA-DEVELOPER-POWER coloumn and the code doesn't work (RSS is not calculated). If I copy the "Power" column into Basic Data, GC recognizes the power data and correctly calculates the RSS metric (like using Stryd Zones).

How should I modify the code so that it recognize the power data in XDATA-DEVELOPER?


See attached a fit file generated using "pbRUN Power" app.


Thank you in advace.

Andrea


17972436613_ACTIVITY.fit

Ale Martinez

unread,
Jan 11, 2025, 5:30:09 PM1/11/25
to golden-cheetah-users
El sábado, 11 de enero de 2025 a la(s) 6:21:43 p.m. UTC-3, Andrea Sabba escribió:

I use Stryd for running, not with Stryd Zones but with the "pbRUN Power" app. I defined a metric called RSS, which represents the TSS for the run, that works with Stryd Zones app:


{

relevant {(isRun) && Data contains "P"; }

value { 0.03 * Duration * IF^3.5; }

count { Duration; }

}

The file fit generated by Forerunner 965 + "pbRUN Power" app, instead, once imported in GC, it conteins the power data into the XDATA-DEVELOPER-POWER coloumn and the code doesn't work (RSS is not calculated). If I copy the "Power" column into Basic Data, GC recognizes the power data and correctly calculates the RSS metric (like using Stryd Zones).


 

How should I modify the code so that it recognize the power data in XDATA-DEVELOPER?


This is more complex since you would need to compute NP from XData series and other standard charts and metrics still will not work. 

Andrea Sabba

unread,
Jan 12, 2025, 9:01:03 AM1/12/25
to golden-cheetah-users
I've tried that Custom Data Processor, when i push the "Run" button nothing happen in the Python console and no message error appear. Python seems installed, I admit that I don't know anything about Python so it's obvious that I'm doing something wrong, any suggestions to help me understand what I'm doing wrong?
Message has been deleted

ZajtiM

unread,
Jan 12, 2025, 10:39:37 AM1/12/25
to golden-cheetah-users
I usually use "print()" to see if i'm getting any data. Can be used for "debugging", when you don't have any real bugs in your code. Or when you're not getting anything back, or results are not what you expected / want. You can use multiple prints to see where data "stops", etc.
Basic print example:
your_variable = "some data"
print(your_variable)  # this should print out "some data"

As you can se here:
https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Working-with-Python#gcathlete
Examples always use "print()" to show basic data.

You could maybe post your code, since you already posted your fit file.

Andrea Sabba

unread,
Jan 12, 2025, 11:20:59 AM1/12/25
to golden-cheetah-users
Hi ZajtiM,
thanks for your response. This is the code I tried:

activity = GC.activity()
series = activity.keys()
if 'DEVELOPER_POWER-2' in series:
power = GC.series(GC.SERIES_WATTS)
for i,p in enumerate(activity['DEVELOPER_POWER-2']):
power[i] = p
if 'DEVELOPER_CADENCE-2' in series:
rcad = GC.series(GC.SERIES_RCAD)
for i,c in enumerate(activity['DEVELOPER_CADENCE-2']):
rcad[i] = c
if 'DEVELOPER_RUNVERT-2' in series:
rvert = GC.series(GC.SERIES_RVERT)
for i,v in enumerate(activity['DEVELOPER_RUNVERT-2']):
rvert[i] = v
if 'DEVELOPER_RUNCONTACT-2' in series:
rcontact = GC.series(GC.SERIES_RCONTACT)
for i,c in enumerate(activity['DEVELOPER_RUNCONTACT-2']):
rcontact[i] = c



Andrea
Message has been deleted

ZajtiM

unread,
Jan 12, 2025, 12:18:03 PM1/12/25
to golden-cheetah-users
Hey Andrea,

1. Main problem why you don't see anything is. You didn't setup any output (print()) for example. Your script is only processing data.
2. Even if you would setup prints, you would not see anything because "if" conditions. You're looking for "DEVELOPER_POWER-2, DEVELOPER_CADENCE-2, etc." but these keys don't exist.

For example: "print(activity.keys())" will output activity keys you can see on attached image. These are keys from your Fit file. Keys are also case sensitive, sou you need to be careful when using them.
activity_keys.png
This is just a basic / quick answer. I'm working on some new feature for GC at the moment. So if you're not in a hurry, i can "fix" it. But can't promise you how fast i can do it.

Just one question. You only want to see numbers for "power", "cadence", "vertical" and "contact"? Because that's what your code looks like at the moment.

Andrea Sabba

unread,
Jan 12, 2025, 12:32:06 PM1/12/25
to golden-cheetah-users
  At the moment, I’m only interested in seeing the power-related numbers and having it automatically calculate the "RSS" metric I created. 
Thanks for the support, no rush. 
Best regards.  
Andrea
Message has been deleted

ZajtiM

unread,
Jan 12, 2025, 2:57:42 PM1/12/25
to golden-cheetah-users
I never used new Data Processors in GC so i didn't know what "Fix Garmin-Stryd Power and Running Dynamics" (code you posted) supposed to do.
I assume you just want to "transfer" power data that is stored in Developer / XData.

I just tested the code in Data processor and it added your XData power into GC.SERIES_WATTS. Now you should be able to see your power data in Overview tiles like Power zones, etc. And i assume it should be easier to calculate your RSS / rTSS (running TSS).


This code will transfer your power: Indents are important.
if 'Power' in GC.xdataNames("DEVELOPER"):
    power = GC.series(GC.SERIES_WATTS)
    for i,p in enumerate(GC.xdataSeries("DEVELOPER","Power")):
        power[i] = p


Before running this code (all power data is 0)
berfore_running_code.png

After running this code (XData is transferred)
after_running_code.png

Now "Power zones" displaying data, which it didn't before running the code. It might show you different data, because of your own Zones.
Power_zones.png

Andrea Sabba

unread,
Jan 13, 2025, 5:07:13 PM1/13/25
to golden-cheetah-users
Hi ZajtiM,
It works!

Thank you 

Reply all
Reply to author
Forward
0 new messages