Icu Get Activity Window Stats
icu_get_activity_window_statsCompute per-window summary statistics for one activity to compare HR, power, and ventilation drift across fixed blocks or custom ranges, optionally filtering by power, without returning raw streams.
Instructions
Compute exact SUMMARY statistics of one activity per time WINDOW (every N minutes, N equal parts, or explicit ranges) on the server, without returning raw streams.
Use for drift questions: "how did HR/power and ventilation/power develop over the ride?", "compare 15-min blocks, ignoring everything below 120 W". Prefer this over icu_get_activity_streams for any averaging; use icu_get_activity_intervals for the activity's own laps.
Each window has icu — computed by Intervals.icu on the whole window (avg/NP watts,
HR, decoupling, breath rate, ventilation, tidal volume, DFA a1, plus hr/ve/br per watt)
— and, when
streams or a power filter is given, filtered — mean/median/min/max computed here on
samples passing the filter, plus _per_watt. analysis adds Intervals.icu's
whole-ride Pw:HR decoupling and each ratio's drift vs the first window.
Breath rate comes from Tyme Wear (measured), else the HRV app (custom stream on FIT
field RespirationRate), else the recording device (head unit/watch, device names
it); the last two are HR-derived estimates —
breath_rate_source says which and whether it was measured.
Aliases: VE -> tidal_volume_min, VT -> tidal_volume, BR -> respiration (or the HRV
stream). Missing streams are reported with suggestions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lag_s | No | In `filtered`, pair power at t with the other streams at t+lag_s (HR lags power ~15-30 s) | |
| parts | No | Split the activity into this many equal parts | |
| streams | No | Extra streams to compute here (mean/median/min/max and per-watt ratio), e.g. ['VE', 'BR', 'TymeVentilation']. Custom names are case-sensitive. | |
| windows | No | Explicit windows as [[start_s, end_s], ...] in elapsed seconds. Give one of block_minutes / parts / windows; none = whole activity. | |
| max_power | No | Drop samples above this power (surges) from `filtered` | |
| min_power | No | Drop samples below this power (coasting/stops) from `filtered` | |
| activity_id | Yes | Activity ID | |
| block_minutes | No | Split the activity into consecutive blocks of this many minutes | |
| power_smoothing_s | No | Apply min/max_power to the trailing N-second mean power instead of raw 1-s power |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |