Route Segments

599 views
Skip to first unread message

juergenws cycling

unread,
Aug 5, 2020, 3:36:24 AM8/5/20
to golden-cheetah-users
Hi, 

i've added a new athlete (we often ride together) and would like her rides to have the same Route Segments i've already set up on my rides.
How can i do that without having to set them up fresh for her?

Cheers
Juergen 

Ale Martinez (Please don't email or cc me)

unread,
Aug 5, 2020, 6:41:10 AM8/5/20
to golden-cheetah-users
Route definitions are stored in config/routes.xml under athlete’s directory

juergenws cycling

unread,
Aug 6, 2020, 1:52:37 AM8/6/20
to golden-cheetah-users
Hi Ale, 

found it, copied it. 

Thank you very much!

juergenws cycling

unread,
Aug 6, 2020, 2:10:55 AM8/6/20
to golden-cheetah-users
Ale, 
this is probably pushing it too far; but can GC compare two athletes on the same route segment ?

Cheers
Juergen

Ale Martinez (Please don't email or cc me)

unread,
Aug 6, 2020, 9:16:19 AM8/6/20
to golden-cheetah-users

juergenws cycling

unread,
Aug 8, 2020, 2:43:28 AM8/8/20
to golden-cheetah-users
Awesome!

Thank you, Ale!


On Wednesday, August 5, 2020 at 5:36:24 PM UTC+10, juergenws cycling wrote:

juergenws cycling

unread,
Aug 9, 2020, 9:41:09 PM8/9/20
to golden-cheetah-users
Hi Ale, 

thank you again for all your tips! 

Here's my last question at least for now:
Is there a way to display metrics for a given segment OVER TIME in a graph?
I played around a little with the compare panel in Trends and Activities views but could not figure out a way to access segments anywhere from within Trends view.

Cheers
Juergen 

Ale Martinez (Please don't email or cc me)

unread,
Aug 9, 2020, 10:20:44 PM8/9/20
to golden-cheetah-users
There is no built in charts for segments or intervals in Trends but APIs allow to build them in R or Python, here you can find an example: https://groups.google.com/d/msg/golden-cheetah-users/8_46zNfXueU/zhwmX8DUBQAJ

For future versions there is a thread where you can contribute ideas for a segments/intervals view: https://groups.google.com/d/msg/golden-cheetah-users/k26lR6FxABk/dqWnLRsHBgAJ

saalmu...@gmail.com

unread,
Aug 16, 2020, 9:01:55 PM8/16/20
to golden-cheetah-users
Hi Ale, 
thank you for the example - gave me a good start. 

I hit a snag with coding the chart i want, which should show some interval metrics of the intervals for a selected activity for these intervals OVER TIME: 
I can get the relevant intervals from GC.activityIntervals and use that list as a filter to fish out these intervals from GC.seasonIntervals which will have all the data i need for a time series plot for these intervals.

I'm running the Python code from "activities" view so the call to  GC.seasonIntervals seems to give me the data from a random season, or the most recent season i looked at in "Trends" view. So I need to explicitly pass a "season" value (like "All Dates") to the call to GC.seasonIntervals to set the date range for the interval metrics time series. Is there a way to do that? (can't find how to do that  in https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Working-with-Python)

In general terms the question is: how can i retrieve season data for a specified season from "activities" view and activity data for a specified activity from "trends" view from the GC API?

Thank you very much for your help, Ale.

Cheers
Juergen

saalmu...@gmail.com

unread,
Aug 16, 2020, 9:28:32 PM8/16/20
to golden-cheetah-users
Hi Ale, 
this might be the wrong location to post this, but perhaps you could have a quick look anyway?

I'm currently tracking my PMC in an excel spreadsheet and the chart below shows the planned versus actual data. The actual TSS for future dates is set to the planned TSS and get overwritten with actual TSS as time goes by. This avoids the future values to be all zero and therefore shows expected discrepancies between planned and actual for future dates.  
XLS.JPG
In Golden Cheetah i started on a PMC chart to replicate the picture above:
GC.JPG

The planned PMC data in the screenshot is just the XLS data read into a dataframe at the moment.
- Is there a way i can establish a new dict like GC.plannedActivity that could store planned PMC data?
- Is it possible to use the GC API ti write data into a dict, rather than reading it out (to bulk update future dated activities and planned activities?

 Thank you, Ale.
Cheers
Juergen

Ale Martinez (Please don't email or cc me)

unread,
Aug 17, 2020, 2:27:56 AM8/17/20
to golden-cheetah-users
El domingo, 16 de agosto de 2020, 22:01:55 (UTC-3), saalmu...@gmail.com escribió:
Hi Ale, 
thank you for the example - gave me a good start. 

I hit a snag with coding the chart i want, which should show some interval metrics of the intervals for a selected activity for these intervals OVER TIME: 
I can get the relevant intervals from GC.activityIntervals and use that list as a filter to fish out these intervals from GC.seasonIntervals which will have all the data i need for a time series plot for these intervals.

I'm running the Python code from "activities" view so the call to  GC.seasonIntervals seems to give me the data from a random season, or the most recent season i looked at in "Trends" view.

 seasonIntervals is intended to be used in Trends view, so it uses the currently selected season/date range, for what you are trying to do, I think dropping the interesting segment(s) to compare pane and using GC.activityMetrics(compare=True) is the way to go

Ale Martinez (Please don't email or cc me)

unread,
Aug 17, 2020, 2:52:56 AM8/17/20
to golden-cheetah-users
El domingo, 16 de agosto de 2020, 22:28:32 (UTC-3), saalmu...@gmail.com escribió:
Hi Ale, 
this might be the wrong location to post this, but perhaps you could have a quick look anyway?

The group is for this purpose, perhaps a separate thread would be better
 
I'm currently tracking my PMC in an excel spreadsheet and the chart below shows the planned versus actual data. The actual TSS for future dates is set to the planned TSS and get overwritten with actual TSS as time goes by.

IIRC, you can do that using “Coggan Expected Chronic Training Load” and it’s cousins in a PMC Chart 

saalmu...@gmail.com

unread,
Aug 19, 2020, 8:12:05 PM8/19/20
to golden-cheetah-users
Hi Ale, 

thank you very much ! That is what i needed exactly. It's working now, here's the code:

##

import plotly

import plotly.graph_objs as go

from plotly.subplots import make_subplots

import tempfile

import pathlib

import pandas as pd

import dateutil

import datetime

from datetime import date, timedelta, datetime

chartTitle = "Segment History"

showColumns = ['Power', 'BPM', 'Duration']

colors = ['#FFFF00', '#E07220', '#45CE32']

fig = go.Figure()

df = []

Date = []

Power = []

BPM = []

TSS = []

dl = []

data = []


# Get GC Data for activity from Compare panel

df = pd.DataFrame(GC.activityMetrics(compare=True))

# select only the dicts from the dataframe

data = df.iloc[:,0]

# convert the selected series into a list of dicts

dl = data.values.tolist()

# convert the list of dicts into a dict of dists

dataS = {k: [dic[k] for dic in dl] for k in dl[0]}


Dates = dataS["date"]

Power = dataS["Average_Power"]

BPM = dataS["Average_Heart_Rate"]

Duration = dataS["Duration"]

TSS =dataS["TSS"]

dataQ = {'datetime': Dates, 'Power': Power, 'BPM': BPM, 'Duration': Duration}


# Modify the data for charting

df = pd.DataFrame(dataQ)

df.columns = ['datetime', 'Power', 'BPM', 'Duration']

df.index = df['datetime']


# Create figure with secondary y-axis

fig = make_subplots(specs=[[{"secondary_y": True}]])

# Create and style traces

for k in range(0,2):

fig.add_trace(go.Scatter(visible=True, x=Dates, y=df[showColumns[k]], name=showColumns[k], line=dict(color=colors[k], width=1)),secondary_y=False)

fig.add_trace(go.Scatter(visible=True, x=Dates, y=df[showColumns[2]], name=showColumns[2], line=dict(color=colors[2], width=1)),secondary_y=True)

# Edit the layout

fig.update_layout(title=chartTitle, xaxis_title='Date', yaxis_title='Power / BPM', plot_bgcolor='#343434', paper_bgcolor='#343434', xaxis_gridcolor='rgba(0,0,0,0)', yaxis_gridcolor='#5e5e5e', font_color='white', hovermode='x')

fig.update_yaxes(title_text="<b>Power / BPM</b>", secondary_y=False)

fig.update_yaxes(title_text="<b>Duration [s]</b>", secondary_y=True,showgrid = False)

# Define temporary file

temp_file = tempfile.NamedTemporaryFile(mode="w+t", prefix="GC_", suffix=".html", delete=False)

# Prepare plot

plotly.offline.plot({"data": fig}, auto_open = False, filename=temp_file.name)

# Load plot

GC.webpage(pathlib.Path(temp_file.name).as_uri())



saalmu...@gmail.com

unread,
Aug 19, 2020, 8:34:28 PM8/19/20
to golden-cheetah-users
Hi Ale, 
sorry to have to ask a follow up:
- i looked at the expected Coggan values and they have no values in the PMC chart for past and future (i must be missing something)
- the expected PMC values are not in GC.season.PMC or GC.seasonMetrics - where can i find them?
- how can i bulk upload planned, future activities (just dicts of datetimem and TSS) ?

(what is IIRC ??)
Thanks, Ale! 

saalmu...@gmail.com

unread,
Aug 19, 2020, 9:55:36 PM8/19/20
to golden-cheetah-users
One last thing: 
When i drag a segment into the compare panel all instances are unticked; if i have a large number of instances it is painfully to manually tick them all; 
Is there an option to have them all ticked when dragged in? I'm using v3.6
Tried all combinations of ON/OFF in the panel and selecting various seasons and "All Selected"

Cheers
Juergen 

Ale Martinez (Please don't email or cc me)

unread,
Aug 20, 2020, 8:42:05 AM8/20/20
to golden-cheetah-users
El miércoles, 19 de agosto de 2020, 21:34:28 (UTC-3), saalmu...@gmail.com escribió:
Hi Ale, 
sorry to have to ask a follow up:
- i looked at the expected Coggan values and they have no values in the PMC chart for past and future (i must be missing something)
- the expected PMC values are not in GC.season.PMC or GC.seasonMetrics - where can i find them?
- how can i bulk upload planned, future activities (just dicts of datetimem and TSS) ?

(what is IIRC ??)

If I remember correctly, this is an incomplete feature and I have not used it recently, Expected PMC values are available via Metric Trends char, not APIs, and they should take values when BikeStress is set for activities on future dates.

There is no API to create activities, a workaround is to generate them in .gc or .json format (create a manual one and export to see the format) and bulk import them.

Planing features are expected to be added for v3.6

Ale Martinez (Please don't email or cc me)

unread,
Aug 20, 2020, 8:42:43 AM8/20/20
to golden-cheetah-users
I don’t know

saalmu...@gmail.com

unread,
Aug 21, 2020, 12:14:55 AM8/21/20
to golden-cheetah-users
Thank you for all your advise, Ale!

saalmu...@gmail.com

unread,
Sep 16, 2020, 2:14:40 AM9/16/20
to golden-cheetah-users
Hi Ale, 
i hope all is well for you.
I just noticed that my average BPM is much lower for rides where i took a break as compared to what my Garmin and Strava say.
Suppose GC does not ignore "non-moving time"? Is there a switch to only calculate averages during moving time?


Thank you
Juergen

Ale Martinez (Please don't email or cc me)

unread,
Sep 16, 2020, 7:53:55 AM9/16/20
to golden-cheetah-users
El miércoles, 16 de septiembre de 2020, 3:14:40 (UTC-3), saalmu...@gmail.com escribió:
Hi Ale, 
i hope all is well for you.
I just noticed that my average BPM is much lower for rides where i took a break as compared to what my Garmin and Strava say.
Suppose GC does not ignore "non-moving time"?

 Yes, Average HR is computed for all samples with HR>0

Is there a switch to only calculate averages during moving time?

No, but a formula or user metric could do the adjustment 
Reply all
Reply to author
Forward
0 new messages