Page 1 of 1

Tool (free) for graphical comparison of c2 stroke data.

Posted: January 7th, 2025, 1:37 pm
by HornetMaX
Hi all,

I had to take a forced break from training and used the spare time to write some (probably bad) code for a tool that essentially compares c2 stroke data across different workout/sessions (I'm sure it works for RowErg and SkiErg, maybe also for BikeErg but I don't have one so I cannot check). Here's an example of what it does:

Image

Link to the source code (python): here

A bit of explanation on how to use it:
  1. It's python code so you'll have to install python 3.11, and a few packages (pandas, matplotlib and tk, if I recall correctly, they will also install their dependencies, automatically). After installing python, just run from a shell "pip install pandas" and the same for matplotlib and tk.
  2. You run it from a shell like "python c2plot --help" to see the different command line options. In a nutshell if you pass one or more c2 .csv files it will show them, else it will open a file selection dialog to allow you to handpick the .csv files you want to graph. You can pass/pick one or more .csv files (2 in the example above).
  3. Once the graph is on you'll see:
    • Three rows of plots, for "Heart Rate", "Pace" and "Stroke Rate" (I can easily add Watts and Cal/Hr but I don't see the point, maybe Watts makes sense or I can let you chose via command-line options).
    • One column of plots for each interval in your workouts: in the example above I'm comparing 2 sessions, each being a 4x1000m, so you have 4 columns.
    • The solid line are the actual data (either raw data, or a centred moving average to smooth things out a bit, see the command-line options for details), the dashed lines are averages over the time range currently displayed: this means that if you zoom on a part of the x axis (time), the average will change.
  4. You can interact with the plot with the buttons at the bottom:
    • The lens icon allow to zoom (a rectangle by default, but if you press 'x' or 'y' while clicking & dragging it will only zoom in x or y axis). When you zoom in y axis, it will zoom for the entire row of plots. When you zoom in x axis, it will zoom for the entire column of plots.
    • The cross icon allows to pan (when you are zoomed in) by clicking & dragging.
    • The sliders icon allows to tweak some graph spacing settings.
    • The disk icon is to save to an image.
    • Left and Right arrows icons are sort of "Undo" & "Redo".
    • The home icon resets everything.
    • If you click near a data line, you'll see a tooltip with the numerical values of the selected point.
  5. Close the graph to go back to your shell.
  6. If your files are named as per concept2 convention (e.g. concept2-result-96306722.csv), it will only keep the numerical part as a label, else it will keep the entire file name (just to make the legends a bit smaller).
Tool is free, feel free to use, improve, make suggestions and/or ask for features.

Re: Tool (free) for graphical comparison of c2 stroke data.

Posted: January 7th, 2025, 5:05 pm
by Sakly
That's a very nice tool :)
If I would have a PC in use, I definitely would try it. But my machine is so old, I only use it once in a year and do all my stuff with my smartphone :?

Re: Tool (free) for graphical comparison of c2 stroke data.

Posted: January 8th, 2025, 3:14 am
by Nomark
Wow, that looks awesome. I love data (a little too much) so will definitely be checking this out later. Thanks for making it.

Re: Tool (free) for graphical comparison of c2 stroke data.

Posted: January 8th, 2025, 5:22 am
by p_b82
I'm sure I'll pull it down at some point and have a play around with it, I also like data!

- python is embedded in my linux distro, so just have a few modules to install I reckon.

Spent some time about 10 years ago playing around with tk - even have a book - so there may even be a chance I can make some constructive comments

Re: Tool (free) for graphical comparison of c2 stroke data.

Posted: January 10th, 2025, 10:30 pm
by Ombrax
Very nice!

I see I'm not the only one who's faced the hassle of formatting erg pace time and displaying it in the traditional manner...

Re: Tool (free) for graphical comparison of c2 stroke data.

Posted: January 11th, 2025, 5:09 am
by HornetMaX
Ombrax wrote:
January 10th, 2025, 10:30 pm
Very nice!

I see I'm not the only one who's faced the hassle of formatting erg pace time and displaying it in the traditional manner...
I've just been lazy, it's surely doable with a few extra lines of code.
First time I'm bored I'll have a look.

BTW, I'm very impressed that the whole thing is roughly 200 lines of code, including empty lines, comments and a lot of boilerplate code.