IndieVelo - Zwift alternative

OK! Thx! Idid it.
But how to create from that stream new custom field with average value of Powermeter Power in intervals?

I just created a custom activity field for that. Click Custom and search for “Avg PM Power”. The script looks like this:

out: {
  let data = streams.PowermeterPower
  if (!data) break out
  let tot = 0, n = 0
  for (let w of data) {
    if (typeof w === 'number') {
      tot += w
      ++n
    }  
  }
  let avg = n > 0 ? tot/n : 0
  avg
}
1 Like

Tnx! :+1: This script calculate average of Powermeter Power of whole activity, But how to modify that for calculate avg in each intervals?

Once you have the custom stream, you can add a ‘Field’ with a script to calculate the avg power from that stream for selections and intervals. The avg will then be available on the Activity page and on the Interval Data page.

I added a custom interval field for that. Click “Fields” and then search for it “Avg PM Power”. The script is as follows:

out: {
  let data = streams.PowermeterPower
  if (!data) break out
  let tot = 0, n = 0
  for (let i = interval.start_index; i < interval.end_index; i++) {
    let w = data[i]
    if (typeof w === 'number') {
      tot += w
      ++n
    }
  }
  let avg = n > 0 ? tot/n : 0
  avg
}
1 Like

@david Замечательно! Большое спасибо! Это именно то, что было нужно!

@david Amazing! Thank you very much! This is exactly what was needed!

1 Like

I believe that bots can be identified by the IndieVelo inscription on their beebs :laughing:

Nope! Many humans have that (it depends what kit is selected) and many bots wear full team kit.

Here are two bots:


@david ! В fit-файле IndieVelo теперь есть информация о погоде в разделе ‘Weather Conditions’. Вы можете сделать Custom field с этой информацией?


@david! The IndieVelo fit file now has weather information in the ‘Weather Conditions’ section. Can you make a Custom field with this information?

I added Wind Direction and Wind Speed. If there are multiple “Weather Conditions” messages then the last one in the file is used.

2 Likes

@david Thank you very much! But the wind direction value in this field is not equal to the value in the fit file. I read the file through fitfileviewer and saw that the Weather Conditions section only has 1 line: wind direction = 14 degrees, wind speed = 1.4 m/s. In the custom fields I see a different value: WD=266 degrees and WS=1.3m/s. Why?
WC

The wind speed one I created has a convert option set to km/h to convert the m/s value from the file.

I am looking at your ride on 12th Feb and the wind direction matches the file?

@david Thank you very much for your answer!
Now I understand the reason for the discrepancies in the data!
I was reading the data from the original IndieVelo file and your script is reading it from the icu file.
Apparently, in the process of transferring the fit file from indievelo, data transformation occurs.
I additionally loaded the original fit file from indievelo into icu and then the wind direction and speed values coincided.
Here is a link to the file of my last workout on February 18th 4AE66FB8118BECC4_20240218_144825_c.fit

@david! I contacted George Gilbert and he writes: “This is normal – the two FIT files are created in different places (one on your computer, and one on the server) and due to network latency etc, will be very slightly different from each other . There should be no material difference however!”.
I believe that the correct file will be the one generated earlier, since after the end of the training the initial weather conditions probably change.

1 Like