Pace ascent not taken into account

How to make sure the pace is not taken into account during the descent (Z7) in a skimo activity? What I’m interested in is the pace during the ascent.

Probably Actions - Ignore Part can achieve what you want.

I’m also interested in this for my XC Skiing/Nordic Skiing activities.

Also, does anyone know how to write a custom activity field that gets my average pace exluding the times when the gradients are below 0, ie. the descents.

With a little help from Copilot, I might have found a solution for the Custom Activity Field at least:

{
// Retrieve data streams for time, distance, and gradient
const timeStream = streams.get(“time”);
const distanceStream = streams.get(“distance”);
const gradientStream = streams.get(“grade_smooth”);

// Check if the necessary streams are available
if (timeStream && distanceStream && gradientStream) {
const time = timeStream.data;
const distance = distanceStream.data;
const gradient = gradientStream.data;

let totalTime = 0;
let totalDistance = 0;
let adjustedTime = 0;

// Calculate total time and distance, adjusting for gradient (exclude negative gradients)
for (let i = 1; i < time.length; i++) {
  let deltaTime = time[i] - time[i - 1];
  let deltaDistance = distance[i] - distance[i - 1];
  let grad = gradient[i];

  if (grad >= 0) {
    // Adjust time based on gradient
    let adjustedFactor = 1.0; // Default factor for flat terrain
    if (grad > 0) {
      adjustedFactor = 1.1; // Example factor for uphill adjustment
    }

    totalTime += deltaTime;
    totalDistance += deltaDistance;
    adjustedTime += deltaTime * adjustedFactor;
  }
}

if (totalDistance > 0) {
  // Calculate GAP in seconds per kilometer
  const gapSecPerKm = (adjustedTime / totalDistance) * 1000;

  // Convert GAP to minutes per kilometer (min/km)
  const gapMinPerKm = gapSecPerKm / 60;

  // Output GAP as a number in min/km
  gapMinPerKm;
} else {
  // Return null if no valid data
  null;
}

} else {
// Return null if necessary data streams are missing
null;
}
}

Using the streams ‘velocity_smooth’ and ‘grade_smooth’ will probably give better results.

velStr = streams.get(“velocity_smooth”).data;
gradStr = streams.get(“grade_smooth”).data;

Let the script calculate velocity and set the display options to convert to pace. That gives proper pace display as mm:ss/km.

@MedTechCD Thanks for the input. I’ll try that :slight_smile: