{
 "name": "tutorial-cs04-messy-watch-export",
 "title": "Tutorial CS-4: A messy watch export to a clean table",
 "description": "Take 693 activity summaries in a watch's own field names and units, audit every unit with an identity, write the cleaning rules first, keep a change log, and produce a quarterly running summary a coach can trust.",
 "homepage": "https://apopt.com/data/tutorials/cs04-messy-watch-export/",
 "licenses": [
  {
   "name": "CC BY 4.0",
   "path": "https://creativecommons.org/licenses/by/4.0/"
  }
 ],
 "created": "2026-12-03",
 "keywords": [
  "tutorial",
  "case study",
  "watch",
  "units",
  "cleaning",
  "change log",
  "case file",
  "running"
 ],
 "resources": [
  {
   "name": "clean-activities_categorized.csv",
   "path": "clean/activities_categorized.csv",
   "url": "https://apopt.com/data/tutorials/cs04-messy-watch-export/clean/activities_categorized.csv",
   "format": "csv",
   "mediatype": "text/csv",
   "bytes": 121248,
   "hash": "sha256:8c00b47c0945b264f69469875433e04b9676deda9e63a3523de456846f19dff2",
   "description": "Cleaned copy written by the tutorial",
   "rows": 693,
   "schema": {
    "fields": [
     {
      "name": "activity_id",
      "type": "string",
      "unit": "text",
      "description": "row id (local start time and sport)"
     },
     {
      "name": "start_local",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "utc_offset_h",
      "type": "number",
      "unit": "h",
      "description": "local clock minus UTC at the start"
     },
     {
      "name": "sport",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "sub_sport",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "distance_km",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "moving_min",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "elapsed_min",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "cadence_spm",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "step_m",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "stance_ms",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "vert_osc_mm",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "vert_ratio_pct",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "power_w",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "pedal_rpm",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "strokes_per_min",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "max_speed_mps",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_hr_bpm",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "max_hr_bpm",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "ascent_m",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "energy_kcal",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "pace_min_km",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "category",
      "type": "string",
      "unit": null,
      "description": null
     }
    ],
    "missingValues": [
     ""
    ]
   }
  },
  {
   "name": "clean-change_log.csv",
   "path": "clean/change_log.csv",
   "url": "https://apopt.com/data/tutorials/cs04-messy-watch-export/clean/change_log.csv",
   "format": "csv",
   "mediatype": "text/csv",
   "bytes": 223,
   "hash": "sha256:e7f39b38902fe24ce09f1e44057d4e5329984040e6b5bfe4eec351a4c89f4ed8",
   "description": "Cleaned copy written by the tutorial",
   "rows": 7,
   "schema": {
    "fields": [
     {
      "name": "rule",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "values",
      "type": "number",
      "unit": null,
      "description": null
     }
    ],
    "missingValues": [
     ""
    ]
   }
  },
  {
   "name": "clean-quarter_summary.csv",
   "path": "clean/quarter_summary.csv",
   "url": "https://apopt.com/data/tutorials/cs04-messy-watch-export/clean/quarter_summary.csv",
   "format": "csv",
   "mediatype": "text/csv",
   "bytes": 647,
   "hash": "sha256:fe0651140933930df1e0eb635a1eee473980d05d93204ee67075d809b6a0cede",
   "description": "Cleaned copy written by the tutorial",
   "rows": 11,
   "schema": {
    "fields": [
     {
      "name": "quarter",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "runs",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "km",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "long_km",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "median_pace",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "cadence",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "hr",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "other_h",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "weeks",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "km_per_week",
      "type": "number",
      "unit": null,
      "description": null
     }
    ],
    "missingValues": [
     ""
    ]
   }
  },
  {
   "name": "expected-printed-output.txt",
   "path": "expected/printed-output.txt",
   "url": "https://apopt.com/data/tutorials/cs04-messy-watch-export/expected/printed-output.txt",
   "format": "text",
   "mediatype": "text/plain",
   "bytes": 5484,
   "hash": "sha256:aad1274a3a00e1e96e107047034d43cf96db3916872d0ecf7b2bbd266c2a2ef6",
   "description": "Everything the tutorial prints, cell by cell"
  },
  {
   "name": "raw-activities_clean.csv",
   "path": "raw/activities_clean.csv",
   "url": "https://apopt.com/data/tutorials/cs04-messy-watch-export/raw/activities_clean.csv",
   "format": "csv",
   "mediatype": "text/csv",
   "bytes": 94240,
   "hash": "sha256:0e188cb77317ef9122320be9526c9c9fd70eacd5d66c3dfd8053aea0f2a48430",
   "description": "the case file's own conversion of the same activities to SI units with local start times, for checking your conversion",
   "rows": 693,
   "schema": {
    "fields": [
     {
      "name": "activity_id",
      "type": "string",
      "unit": "text",
      "description": "row id (local start time and sport)"
     },
     {
      "name": "date",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "start_local",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "sport",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "sub_sport",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "device",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "distance_km",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "moving_time_min",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "elapsed_time_min",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "pace_min_per_km",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_speed_kmh",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_hr_bpm",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "max_hr_bpm",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_cadence_spm",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "step_length_m",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "elevation_gain_m",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "elevation_loss_m",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_power_w",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "calories_kcal",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "load_au",
      "type": "number",
      "unit": null,
      "description": null
     }
    ],
    "missingValues": [
     ""
    ]
   }
  },
  {
   "name": "raw-sessions_fit.csv",
   "path": "raw/sessions_fit.csv",
   "url": "https://apopt.com/data/tutorials/cs04-messy-watch-export/raw/sessions_fit.csv",
   "format": "csv",
   "mediatype": "text/csv",
   "bytes": 117262,
   "hash": "sha256:6ce4b0840738b80e4b3e1c2e1c65199f733fe38c0b678647229d64ccf3274731",
   "description": "693 activity summaries, 28 June 2024 to 28 November 2026, one watch; the FIT session fields with the watch's own names and units",
   "rows": 693,
   "schema": {
    "fields": [
     {
      "name": "activity_id",
      "type": "string",
      "unit": "text",
      "description": "row id (local start time and sport)"
     },
     {
      "name": "start_time",
      "type": "string",
      "unit": "ISO 8601",
      "description": "start in UTC (the \"Z\")"
     },
     {
      "name": "utc_offset_h",
      "type": "number",
      "unit": "h",
      "description": "local clock minus UTC at the start"
     },
     {
      "name": "sport",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "sub_sport",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "total_timer_time",
      "type": "number",
      "unit": "s",
      "description": "moving time (the timer stops on pauses)"
     },
     {
      "name": "total_elapsed_time",
      "type": "number",
      "unit": "s",
      "description": "clock time from start to stop (pauses included)"
     },
     {
      "name": "total_distance",
      "type": "number",
      "unit": "m",
      "description": "distance (wrist accelerometer on indoor runs)"
     },
     {
      "name": "enhanced_avg_speed",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "enhanced_max_speed",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_heart_rate",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "max_heart_rate",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "min_heart_rate",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_running_cadence",
      "type": "number",
      "unit": "strides/min (×2 for steps/min)",
      "description": "cadence of ONE foot on runs"
     },
     {
      "name": "max_running_cadence",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "avg_cadence",
      "type": "number",
      "unit": "pedal rpm (bike); strokes/min (swim); undefined elsewhere",
      "description": "cadence on other sports"
     },
     {
      "name": "total_strides",
      "type": "number",
      "unit": "count",
      "description": "strides of one foot"
     },
     {
      "name": "avg_step_length",
      "type": "number",
      "unit": "mm",
      "description": "distance per step"
     },
     {
      "name": "avg_stance_time",
      "type": "number",
      "unit": "ms",
      "description": "ground-contact time"
     },
     {
      "name": "avg_vertical_oscillation",
      "type": "number",
      "unit": "mm",
      "description": "vertical bounce of the torso"
     },
     {
      "name": "avg_vertical_ratio",
      "type": "number",
      "unit": "%",
      "description": "oscillation ÷ step length"
     },
     {
      "name": "avg_power",
      "type": "number",
      "unit": "W",
      "description": "running power the watch estimates"
     },
     {
      "name": "total_ascent",
      "type": "number",
      "unit": "m",
      "description": "climb (barometer)"
     },
     {
      "name": "total_descent",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "total_calories",
      "type": "number",
      "unit": "kcal",
      "description": "energy estimate"
     },
     {
      "name": "avg_temperature",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "pool_length",
      "type": "number",
      "unit": null,
      "description": null
     },
     {
      "name": "num_active_lengths",
      "type": "string",
      "unit": null,
      "description": null
     },
     {
      "name": "Effort Pace",
      "type": "number",
      "unit": null,
      "description": null
     }
    ],
    "missingValues": [
     ""
    ]
   }
  }
 ],
 "sources": [
  {
   "title": "COROS Training Hub archive of FIT activity files (session summaries only), from the course case file athletes/jh/coros-history"
  }
 ]
}
