Time in zones based on Power or HR for Cycling

445 views
Skip to first unread message

Pierre Tamisier

unread,
Oct 10, 2022, 9:22:20 PM10/10/22
to golden-cheetah-users
Dear GoldenCheetah Community,

I'm using GC3.5 and the Metric Reference from the Wiki. I'm looking to setup a chart for cycling that gives % of time spent in zones using power (if power numbers are available), or fall back to time in HR zones if no power.

To do so I was thinking to recalculate the metrics Ln_Percent_in_Zone and Hn_Percent_in_Zone using "Formula" and combine them together.

Pseudo-code as an example:

Sport = "Bike" ?
     L1_Time_in_Zone > 0 ?
          L1_Time_in_Zone / Duration * 100 : H1_Time_in_Zone / Duration * 100

Do you think I'm on the right track?
Happy to upgrade to GC3.6 and/or use python charts if it's easier.

Cheers,
Pierre

Peret

unread,
Oct 11, 2022, 4:25:02 AM10/11/22
to golden-cheetah-users
In GC 3.6 it is straightforward, as the are in the predefined tiles:
Captura desde 2022-10-11 10-22-46.png

You can have Zones histogram gor power zones and heart rate:

Captura desde 2022-10-11 10-24-35.png

Ale Martinez

unread,
Oct 11, 2022, 10:34:21 AM10/11/22
to golden-cheetah-users
El lunes, 10 de octubre de 2022 a la(s) 22:22:20 UTC-3, pierre....@gmail.com escribió:
Dear GoldenCheetah Community,

I'm using GC3.5 and the Metric Reference from the Wiki. I'm looking to setup a chart for cycling that gives % of time spent in zones using power (if power numbers are available), or fall back to time in HR zones if no power.

To do so I was thinking to recalculate the metrics Ln_Percent_in_Zone and Hn_Percent_in_Zone using "Formula" and combine them together.

Pseudo-code as an example:

Sport = "Bike" ?
     L1_Time_in_Zone > 0 ?
          L1_Time_in_Zone / Duration * 100 : H1_Time_in_Zone / Duration * 100

Do you think I'm on the right track?

That expression is not well formed, see the wiki, to define a metric you should read https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Creating-User-Metrics, in this case value can be as simple as: 
value { Data contains "P" ? Ln_Percent_in_Zone : Hn_Percent_in_Zone;  }
but you also need count for the metrics to aggregate correctly:
count { Time_Recording; }
and you need to use new names, you can't override builtin metrics, to apply this only to Bike activities you can use the relevant function.
 
Happy to upgrade to GC3.6 and/or use python charts if it's easier.

I would recommend to upgrade to v3.6, it has several fixes related to these metrics.

Pierre Tamisier

unread,
Oct 15, 2022, 1:13:54 AM10/15/22
to Ale Martinez, golden-cheetah-users
Cheers Ale. I updated to GC3.6. Based on your response and the doc/wiki I created some user metrics that allow me to track % of time spent in zone based on data available, in this order:
- power (bike)
- pace (run outside)
- HR (bike or run)

I have 7 zones for power and 5 for paces/HR. I created some user metrics in Golden Cheetah > Preferences > Metrics. For example:

image.png

For Z5/Z6/Z7 I default to P5 or H5 when no power is available. I use these user metrics in "Formula" in charts. 
Sharing for folks that may be interested.
Thanks again for your help!

--
Pierre


--
_______________________________________________
Golden-Cheetah-Users mailing list
golden-che...@googlegroups.com
http://groups.google.com/group/golden-cheetah-users?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "golden-cheetah-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golden-cheetah-users/_YvIV8q9Bgs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golden-cheetah-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golden-cheetah-users/6fd12a97-ea5c-4d4e-9a05-0b6a87a8c020n%40googlegroups.com.
Time in Zones 1-5.gchart

Joss Winn

unread,
Oct 15, 2022, 5:14:56 AM10/15/22
to golden-cheetah-users
Aren’t these metrics already available as zone histograms and tables in 3.6 (as activity tiles in the overview) or am I misunderstanding what you have created? 

In the Trends view, time and percent in zones can be built into charts, too.


On 15 Oct 2022, at 06:13, Pierre Tamisier <pierre....@gmail.com> wrote:

Cheers Ale. I updated to GC3.6. Based on your response and the doc/wiki I created some user metrics that allow me to track % of time spent in zone based on data available, in this order:
- power (bike)
- pace (run outside)
- HR (bike or run)

I have 7 zones for power and 5 for paces/HR. I created some user metrics in Golden Cheetah > Preferences > Metrics. For example:

You received this message because you are subscribed to the Google Groups "golden-cheetah-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golden-cheetah-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golden-cheetah-users/CAF_M-KTHUUeM%3DnkeAi_bx_jySm5wbHpb%2BJDW4MKe44yRoCBsnA%40mail.gmail.com.
<Time in Zones 1-5.gchart>

Pierre Tamisier

unread,
Oct 15, 2022, 11:53:02 AM10/15/22
to Joss Winn, golden-cheetah-users
I think we are saying the same thing.
 
Aren’t these metrics already available as zone histograms and tables in 3.6 (as activity tiles in the overview)

It is my understanding that yes they are, but I want a combined version of time spent in zones for all my bike/run workouts (indoors/outdoors), not at the Activity level, but over time.

In the Trends view, time and percent in zones can be built into charts, too.

That's what I'm trying to do, defining User Metrics (Z1/Z2 etc. calculated based on whether the data file has power, pace or HR) as I described in my previous email.

--
Pierre


Reply all
Reply to author
Forward
0 new messages