mrvdb / suuntoapp2gpx

Convert suunto app data to gpx
5 stars 2 forks source link

Read attributes in other samples than GPS data #1

Open wiktorn opened 4 years ago

wiktorn commented 4 years ago

Apart from samples with location information, such as:

    {
      "Attributes": {
        "suunto/sml": {
          "Sample": {
            "GPSAltitude": 91.4,
            "Latitude": 0.31337,
            "Longitude": 0.31337,
            "UTC": "2019-12-30T11:08:45.000+00:00"
          }
        }
      },
      "Source": "suunto-191910002448",
      "TimeISO8601": "2019-12-30T12:08:45.000+01:00"
    },

There are other Samples, containing

It would be nice to include the middle point. The challange here is that they are reported with different timestamps than location data.

And readings from heart beat monitor:

    {
      "Attributes": {
        "suunto/sml": {
          "R-R": {
            "IBI": [
              392,
              410,
              295,
              403,
              322,
              364,
              277,
              335,
              391,
              435
            ]
          }
        }
      },
      "Source": "suunto-191910002448",
      "TimeISO8601": "2019-12-30T12:08:45.580+01:00"
    },

Where IBI stands for "Inter Beat Interval.

The challange here, is that there are multiple samples reported on the same timestamp, which probably needs to be concatenated - as then sum of IBI is close to difference in timestamps. Anyway - IBI data have quite a lot of variation which suggests that this data needs to be cleaned before calculating real BPM.

Data could be then put in either of:

Please bear in mind, that Garmin extension is more restrictive on allowed values:

wiktorn commented 4 years ago

I've already addressed some of above using pandas to easily join the data along time axis, and fill missing location data, for timestamps, where additional data is available, but no location data was gathered.

I've also tried to do some smoothing of IBI, elimination of extreme values, but haven't succeed in getting the values, that Suunto reports itself. Can share it as a pull request.