Skip to main content

Micromotion analysis of motion time series: mocap, IMU and force plate

Project description

micromotion

tests docs PyPI Python License

Analysis of human micromotion in motion time series: optical marker data, body-worn accelerometers, respiration belts and force plates.

The measure the package exists for is quantity of motion — the average speed of a body part, band-limited to 0.2–5 Hz, in millimetres per second. It applies equally to all three sensor families because the shared abstraction is the frequency band, not the instrument.

pip install micromotion
import micromotion as mm

rec  = mm.read("Standstill2017/mocap_data/A0001.tsv")   # dispatches on content, not extension
head = rec.marker("P01")
mm.qom(head, rec.fs, kind="position").median_mm_s   # the median is the convention; .mean_mm_s is also there

Documentation

Reference documentation how to use it, every function, the conventions
Wiki why it works this way — traps, recipes, open questions
Changelog what changed, and why

New to it: Getting started, then The three bands, which is the one convention you cannot skip.

Reading files is its own subject, because the formats in this field lie about themselves: Reading files covers what each reader handles, which axis is vertical in which system, and the traps that produce plausible numbers rather than errors — a Y/Z axis swap that reverses every sway direction while leaving magnitudes intact, a Unicode minus that turns negative values into NaN, an app whose clock stops when the phone sleeps.

What is in it

Module Contents
qom quantity of motion from position or acceleration
filters the band definitions, band-pass, low-pass, high-pass, cardiac notch
resample rate measurement, downsample-only resampling, irregular-to-regular gridding
validate checks that fail loudly on silently-wrong data
posture, balance sway geometry, centre-of-pressure measures
spectral, physio cardiac and respiratory peaks, band power, breathing rate
dynamics DFA, multifractality, recurrence, surrogates, entropy
group whether these people moved at the same moments
align, circular offsets between clocks; directional statistics
io, record one reader per corpus layout, a content sniffer, a common record type

Readers: Qualisys and Qualisys-style TSV in all three header shapes, Sverm, Axivity AX3, Physics Toolbox phone logs (raw app export or cleaned), Equivital, Wii balance board, Artinis fNIRS. read dispatches on content rather than extension, because in this corpus the extension is frequently wrong.

Why it exists

It was built while constructing a single analysis across every dataset in the Oslo Standstill Database. There were 159 analysis scripts, of which 58 defined their own band-pass filter and 37 computed quantity of motion. The project's central measure existed in dozens of copies that did not all agree, and the disagreements were invisible.

Every default here was measured rather than assumed, and the reasoning is kept beside it. The traps page lists the mistakes that shaped the design; each one happened, produced a believable wrong number, and raised nothing at the time.

Requirements

Python 3.10+, numpy, scipy, pandas.

Licence

GPL-3.0-or-later. If you use it, please cite it — see CITATION.cff.

Related toolboxes

These four toolboxes come out of the fourMs lab at the University of Oslo. They are separate packages with separate release cycles, but they are built to be used together and share several implementations, so a measure computed in one agrees with the same measure computed in another.

  • Musical Gestures Toolbox (musicalgestures) — video and audio: motiongrams, videograms, and motion analysis from ordinary video files
  • ambiscape — soundscapes: the sonic ambience of a place, across level, spectral, spatial, temporal, ecological and source descriptors
  • musiscape — music collections: comparing many tracks and albums held as audio files in folders

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micromotion-1.0.0.tar.gz (184.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micromotion-1.0.0-py3-none-any.whl (107.5 kB view details)

Uploaded Python 3

File details

Details for the file micromotion-1.0.0.tar.gz.

File metadata

  • Download URL: micromotion-1.0.0.tar.gz
  • Upload date:
  • Size: 184.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for micromotion-1.0.0.tar.gz
Algorithm Hash digest
SHA256 240872a1c87267f505a78d4d07c989da282bb22bfea87601748371654a657010
MD5 dcbe44bf1d486c91abee47ce2e9bda6b
BLAKE2b-256 4644382dc35937c4f97c055a86a4b9ab9209b868bc6e11d9bd2e20a1959ab91e

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromotion-1.0.0.tar.gz:

Publisher: publish.yml on fourMs/micromotion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromotion-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: micromotion-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 107.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for micromotion-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25e9db09a3a7f8cad5fc5349a9b23ef81b10f14b061fc8070ae605183b6ecef4
MD5 935803135edab06700c7a624dbab101a
BLAKE2b-256 96bc68736b5934682f15913020812556fe9ef9a251692e5bcecd082a6d14af4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromotion-1.0.0-py3-none-any.whl:

Publisher: publish.yml on fourMs/micromotion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page