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
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.
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.
##
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())
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 ??)
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?