Merging 2 files in Cyclingpeaks Software



larrynipon

New Member
Sep 17, 2003
105
0
0
I'm riding with an iBike and a Garmin 305. iBike has power, Garmin gives Cadence and heartrate. I'd like to merge these 2 files into a single file for analysis in Cyclingpeaks. Does anyone have a "step-by-step" on how to do this? There are probably a variety of ways to go about it. I'm looking for the quickest, but also the most accurate. Ive attaced 2 files as an example. These are from Cyclingpeaks. However, it might start with csv files generated from each of the respective software programs bundled wsith the respective device, yada yada...
p.s. - change the name of the files from jpg to wko suffixes.
 
larrynipon said:
I'm riding with an iBike and a Garmin 305. iBike has power, Garmin gives Cadence and heartrate. I'd like to merge these 2 files into a single file for analysis in Cyclingpeaks.
This is a two part question or at least a question with an assumption. When you say "merge," what you probably mean is to treat one of the files as "primary" and then add some of the data from the "secondary" file to the primary file, retaining the primary file's structure (in particular the observation frequency). That you could do pretty easily with a little bit of code. You would create one or more new columns in the primary file, pick a starting point from the time column in both files and then just copy the values from the secondary file on a >= basis (to account for the different observation frequencies). Even if you do this successfully, you now have a file that CP doesn't recognize unless your primary file had all of the columns that you eventually want. IOW, if you simply replace or fill in the blanks of an existing file, it should be something that CP recognizes. If you add columns to a file, it will not be recognized by CP.
 
larrynipon said:
I'm riding with an iBike and a Garmin 305. iBike has power, Garmin gives Cadence and heartrate.
I didn't know iBike didn't have cadence & HR. "Merging" files is a complete pain in the ....
The most popular request is to "merge" (append?) altitude data for PMs that lack this feature. That would be much more useful than HR or cadence.
 
Alex Simmons said:
I didn't know iBike didn't have cadence & HR. "Merging" files is a complete pain in the ....
The most popular request is to "merge" (append?) altitude data for PMs that lack this feature. That would be much more useful than HR or cadence.
But, even if you added an altitude column in the generic file of say, PT, I don't think CP would recognize the altitude data. One would have to first choose the file format with a superset of the desired data columns and then replace the columns with values from another file. I don't know which file format is a superset at this point (Polar?).
 
RapDaddyo said:
But, even if you added an altitude column in the generic file of say, PT, I don't think CP would recognize the altitude data. One would have to first choose the file format with a superset of the desired data columns and then replace the columns with values from another file. I don't know which file format is a superset at this point (Polar?).
Exactly (hence the pain in the ...). I'm not sure if you can export a Polar file (from Polar software) to csv/txt format (since it could have power & altitude columns), use that to modify and then re-import into Polar software, then import that file into CP!! But then polar only has data at 5sec intervals, so you'd lose a bit that way.... Then there's the problem of synchronising the data even if the file formats could be modfied and re-imported successfully.... different recording rates for different PMs for a start and one or two data drops here and there and you're out of synch again.

If I'm really bored one day I might have a play and see what happens. But yes, the format with the superset of data types is primary issue.
 
Alex Simmons said:
Exactly (hence the pain in the ...). I'm not sure if you can export a Polar file (from Polar software) to csv/txt format (since it could have power & altitude columns), use that to modify and then re-import into Polar software, then import that file into CP!!
That's what I was thinking. But, I don't have a Polar file with altitude data to export and look at.

Alex Simmons said:
But then polar only has data at 5sec intervals, so you'd lose a bit that way....
That's solvable, with a >= algorithm based on a common starting point and using each file's minutes column for synchronization. If the primary file has the greater frequency, just cherry pick the other file's values. If the secondary file has the greater frequency, average the values between observations in the primary file. It's crude, but synching two files that have been recorded at different recording frequencies isn't going to be exact anyway.

Alex Simmons said:
Then there's the problem of synchronising the data even if the file formats could be modfied and re-imported successfully.... different recording rates for different PMs for a start and one or two data drops here and there and you're out of synch again.
It's true that it would be nice if there were a data column that would periodically go to an unusual value that one could synchronize with (e.g., speed = 0). Lacking that, just force the fit based on the clocks and hope for the best.

Alex Simmons said:
If I'm really bored one day I might have a play and see what happens. But yes, the format with the superset of data types is primary issue.
I was thinking the same thing, but I have ~5 projects awaiting that day.
 
RapDaddyo said:
That's what I was thinking. But, I don't have a Polar file with altitude data to export and look at.
Thanks for suggestions. I do (from 2-3 years back) and they are all in CP and Polar software, so I have sample data I could try (I don't have a Polar + PT side by side data set but that's not the concern at this stage). I sold the polar once I moved to power, so in reality, it wouldn't be much use to me anyway (and my riding, while it can be on undulating terrain - does not include big climbs like in Europe or the US).
 
Alex Simmons said:
Thanks for suggestions. I do (from 2-3 years back) and they are all in CP and Polar software, so I have sample data I could try (I don't have a Polar + PT side by side data set but that's not the concern at this stage). I sold the polar once I moved to power, so in reality, it wouldn't be much use to me anyway (and my riding, while it can be on undulating terrain - does not include big climbs like in Europe or the US).
It would be nice to use the PT file as primary because it has the greater recording frequency. But, it doesn't have altitude data so CP wouldn't be able to import the altitude data anyway. That means using the Polar as primary and throwing away lots of good data from the PT file to force it into the 5sec recording frequency of the Polar (shame).
 
RapDaddyo said:
Even if you do this successfully, you now have a file that CP doesn't recognize unless your primary file had all of the columns that you eventually want. IOW, if you simply replace or fill in the blanks of an existing file, it should be something that CP recognizes. If you add columns to a file, it will not be recognized by CP.
I've done something similar, but it's a pain. I transfer ride data into an excel file, paste the excel file into a word document, convert the table to text with spaces between data points, and paste this into a .TXT file in Velodyne format that CP recognizes.

But that's more work than the ride itself.
 
JustCurious said:
I've done something similar, but it's a pain. I transfer ride data into an excel file, paste the excel file into a word document, convert the table to text with spaces between data points, and paste this into a .TXT file in Velodyne format that CP recognizes.

But that's more work than the ride itself.
It sounds like it. I would write a small program to do everything at one time, but I'm unlikely to do it anytime soon because I see it as having so little value.