Can you edit heart rate data on a gpx?

pastryboy
pastryboy Posts: 1,385
edited July 2015 in Road general
The wind seems to be messing up my chest rate strap (making my chest cold I assume) and today I was constantly showing 200+ on my ride to work into a headwind. The strap itself works fine because when I went for a run yesterday the results were as expected.

Is there any straightforward way to edit the data to maybe cut out some of the data from a ride so it doesn't mess up averages/fitness on strava?

Comments

  • pblakeney
    pblakeney Posts: 25,773
    You are obviously not putting enough effort into your running.
    The above may be fact, or fiction, I may be serious, I may be jesting.
    I am not sure. You have no chance.
    Veronese68 wrote:
    PB is the most sensible person on here.
  • me-109
    me-109 Posts: 1,915
    Paging Sir Dave.... :wink:
  • NeXXus
    NeXXus Posts: 854
    A practical solution no. A long tedious way yes, open the file in notepad/wordpad, I'm sure you'll soon realise the effort =/= reward
    And the people bowed and prayed, to the neon god they made.
  • pastryboy
    pastryboy Posts: 1,385
    206bpm and doing 20mph on the flat. I won't hold out for Sir Dave's call just yet.

    Ordered some sleeveless base layers from Planet X, hopefully that'll sort it.
  • markhewitt1978
    markhewitt1978 Posts: 7,614
    <trkpt lat="54.8591470" lon="-1.5754310">
    <ele>29.2</ele>
    <time>2015-07-26T07:43:42Z</time>
    <extensions>
    <gpxtpx:TrackPointExtension>
    <gpxtpx:atemp>11</gpxtpx:atemp>
    <gpxtpx:hr>92</gpxtpx:hr>
    <gpxtpx:cad>0</gpxtpx:cad>
    </gpxtpx:TrackPointExtension>
    </extensions>
    </trkpt>


    That's an example data point from one of my .gpx files. You are see the heart rate there after <gpxtpx:hr>

    If you could devise a text editing system to go in and strip out those instances, then you can edit the file. So good luck with that :D
  • buckmulligan
    buckmulligan Posts: 1,031
    Yeah, it's a huge ballache to do manually, but if you can automate it using a text editor "Find and Replace" tool or a program like Excel then it's pretty easy. A simple macro in Excel could remove/replace all values above say 200, but this is complicated if you're not familiar with it.

    Was it a Garmin and do you have the original *.fit file? If so, you can use this tool (link below) to strip out the heart rate data altogether. Annoyingly it doesn't accept anything other than *.fit files, but there may be alternative tools out there:

    https://www.fitfiletools.com/
  • buckmulligan
    buckmulligan Posts: 1,031
    Out of curiosity, I gave the text editor "Find and Replace" idea a try and it's a bit more complicated than I thought.


    First of all, you have to use a text editor than will accept wildcards in the "Find and Replace" tool, so not for example Windows Notepad, but I just used Microsoft Word successfully.

    Secondly, the use of wildcards is a bit confounded, because a lot of the symbols present in a gpx file (for example the < > brackets and colons) also have special uses.

    To do it in Microsoft Word, open up the Find and Replace dialogue (Ctrl + H), click the "More" button and check the "Use Wildcards" checkbox. In the Find field (Using Mark Hewitt's gpx code as an example) put the following:
    \<gpxtpx:hr\>*\</gpxtpx:hr\>

    Note: the extra backslashes are to identify that the < > brackets are not being used as a wildcard function, but as literal string of text.

    In the "Replace" field, you can leave it blank to erase the heart rate data altogether, or you can put in the following if you'd like to subsitute in a constant estimate of HR (in this example "150"):
    <gpxtpx:hr>150</gpxtpx:hr>

    Click the "Replace All" button. If only one section of the GPX file is dodgy, you can use the timestamps to identify and highlight the dodgy section and just perform the "Find and Replace" function on that section.

    Hope that helps!
  • paulbnix
    paulbnix Posts: 631
    You can do fairly complex editing if you use an editor that allow you to record and reply a macro.
    I have used Notepad++ extensively and it has a macro facility.
    It's free and you can get it here https://notepad-plus-plus.org
  • GoldenCheetah has a very good editor for this