Skip to content

DrLundRasmussen/FieldStudyDataTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

FieldStudyDataTools

GitHub repo size GitHub last commit

Table of Contents


Overview

FieldStudyDataTools is a Python package developed to support data processing for the Sensors Field Study 2025 conducted at Curtin University, Perth, Australia by the Healthy Digital Child research group.

The package provides a set of modules for:

  • Resampling raw accelerometer data (from SENS devices)
  • Clearning and resampling outputs from the following classification algorithms:
    • ActiMotus
    • ActiPASS
    • SENS
  • Cleaning and resampling video annotation data
  • Aligning and merging accelerometer data with video annotations

Processing Pipeline (Summary)

The workflow implemented in this package follows these steps:

1. Classification of accelerometer data

Raw 12.5 Hz SENS accelerometer data (thigh-worn) were classified into postures and movements using:

  • ActiMotus (via SENS web application)
  • ActiPASS (offline processing software)
  • SENS algorithm (via SENS web application)

Outputs from each algorithm are in 1-second resolution before further processing.

For further details on the ActiMotus algorithm, please visit the ActiMotus GitHub repository.

For further details on the ActiPASS algorithm, please visit the ActiPASS GitHub repository.


2. Resampling

To enable integration across data sources, the following resampling strategy is applied:

  • Raw accelerometer data (12.5 Hz → 30 Hz)
    Cubic spline interpolation.

  • SENS classified data (5 sec → 1 Hz)
    Interval expansion using forward fill, where each 5-second classification is assigned to all corresponding 1-second timestamps within that interval.

  • Classified data (1 Hz → 30 Hz)
    Projection onto a 30 Hz timeline using nearest-neighbour temporal matching, where each 30 Hz timestamp is assigned the label of the closest 1-second observation.

  • Video annotations (30 Hz → 1 Hz and 5-sec)
    Aggregation using majority vote within each 1-second or 5-second interval.


3. Final dataset construction

The resampled raw accelerometer data, posture and movement classified accelerometer data, and video annotation data are combined based on participant ID and timestamps.

Timestamp handling

All datasets undergo standardised timestamp processing prior to merging:

  • Timestamps are parsed as naive local time (Australia/Perth)
  • Data are sorted and duplicate timestamps are removed
  • Datasets are aligned to a common start time where applicable

Dataset construction

30 Hz dataset

The 30 Hz dataset is constructed using the video annotation data as the master timeline. Raw accelerometer data and classification outputs are merged using nearest-neighbour matching with ±17 milliseconds tolerance.


1 Hz dataset

The 1 Hz dataset is constructed using the ActiPASS data as the master timeline. ActiMotus, SENS, and video data are merged using nearest-neighbour matching with ±500 milliseconds tolerance.


5-second dataset

The 5-second dataset is constructed by merging SENS classified data with video annotation data. Video annotation data define the master timeline and SENS classified data are merged using nearest-neighbour matching with ±2.5 seconds tolerence.


Final datasets

This process results in:

  1. 30 Hz dataset containing:

    • Raw accelerometer data
    • ActiMotus classifications
    • ActiPASS classifications
    • SENS classifications
    • Video annotations
  2. 1 Hz dataset containing:

    • ActiMotus classifications
    • ActiPASS classifications
    • SENS classifications
    • Video annotations
  3. 5-second dataset containing:

    • SENS classifications
    • Video annotations

Installation

Install using pip install fieldstudydatatools.

License

fieldstudydatatools is distributed under the terms of the MIT license.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages