# Cleaning notes

The public S3 archive is the immutable source of provenance. The publication package applies only documented, reproducible corrections.

## Corrections

1. Acceleration EDF dimensions are `g` with physical range `[-8, 8]`.
2. Quaternion EDF dimensions are `1` with physical range `[-1, 1]`.
3. Source values are decoded before the physical ranges are corrected. The builder verifies round-trip error against strict per-channel tolerances.
4. Untrustworthy absolute EDF dates are replaced with the required placeholder `1985-01-01`; EDF headers mark the value as a placeholder.
5. CSV columns and event labels are normalized. Repetition events are named `repetition_marker_*` to reflect their fiducial-window semantics.
6. Source activity tokens are mapped to stable IDs and canonical snake_case labels while remaining available as `source_activity`.
7. `SUBxx` is exposed as `source_subject_code`, not `subject_id`, because the release provides no global participant mapping.
8. Invalid acceleration and quaternion samples are null in Parquet and listed as intervals in the raw archive.
9. Samples outside annotated exercise series have null sample-level activity targets.
10. The legacy preview script is not redistributed; the supported representations are Parquet and corrected EDF/CSV.

## Reproducibility

`scripts/prepare_dataset.py` performs the complete transformation from the immutable source. `metadata/manifest.json` records source and artifact checksums, dependency versions, quality definitions, and maximum EDF round-trip errors.

The quality flags are documented preparation heuristics. Near-zero acceleration is
not rejected on its own because it can occur during an airborne phase; it is marked
invalid only when the simultaneous quaternion is also invalid.

Source: https://aidlab-production-datasets.s3.eu-central-1.amazonaws.com/AIDLAB-HAR-DATASET_v2.zip

Source SHA-256: `bc501d73ad636d9db29ca65525811b9d3a76f7257d1a0f5d9143ccb8bbbd63d7`
