Skip to main content

Python package to process wearable accelerometer data

Project description

actipy

Python package to process Axivity3 (.cwa), Actigraph (.gt3x), and GENEActiv (.bin).

Axivity3 is the activity tracker watch used in the large-scale UK-Biobank accelerometer study.

Installation

Pip

pip install actipy

Conda

conda install -c oxwear actipy

Note: Use either Pip or Conda, not both.

Usage

Process an Axivity3 (.cwa) file:

import actipy

data, info = actipy.read_device("sample.cwa.gz",
                                 lowpass_hz=20,
                                 calibrate_gravity=True,
                                 detect_nonwear=True,
                                 resample_hz=50)

Output:

data [pandas.DataFrame]
                                 x         y         z  temperature
 time
 2014-05-07 13:29:50.430 -0.513936  0.070043  1.671264    20.000000
 2014-05-07 13:29:50.440 -0.233910 -0.586894  0.081946    20.000000
 2014-05-07 13:29:50.450 -0.080303 -0.951132 -0.810433    20.000000
 2014-05-07 13:29:50.460 -0.067221 -0.976200 -0.864934    20.000000
 2014-05-07 13:29:50.470 -0.109617 -0.857322 -0.508587    20.000000
 ...                           ...       ...       ...          ...

info [dict]
 Filename                 : data/sample.cwa.gz
 Filesize(MB)             : 69.4
 Device                   : Axivity
 DeviceID                 : 13110
 ReadErrors               : 0
 SampleRate               : 100.0
 ReadOK                   : 1
 StartTime                : 2014-05-07 13:29:50
 EndTime                  : 2014-05-13 09:50:33
 NumTicks                 : 51391800
 WearTime(days)           : 5.847725231481482
 NumInterrupts            : 1
 ResampleRate             : 100.0
 NumTicksAfterResample    : 25262174
 LowpassOK                : 1
 LowpassCutoff(Hz)        : 20.0
 CalibErrorBefore(mg)     : 82.95806873592024
 CalibErrorAfter(mg)      : 4.434966371604519
 CalibOK                  : 1
 NonwearTime(days)        : 0.0
 NumNonwearEpisodes       : 0
 ...

If you have a CSV file that you want to process, you can also use the data processing routines from actipy.processing:

import actipy.processing as P

data, info_lowpass = P.lowpass(data, 100, 20)
data, info_calib = P.calibrate_gravity(data)
data, info_nonwear = P.detect_nonwear(data)
data, info_resample = P.resample(data, sample_rate)

See the documentation for more.

License

See license before using this software.

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

actipy-1.0.0.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

actipy-1.0.0-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: actipy-1.0.0.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.13

File hashes

Hashes for actipy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bd1db6732e16c5bb39d391a9506b3d086c988f726d19e1bc502dbce6045dfaae
MD5 3b24ff2164fabbc6f27a488a3a94435f
BLAKE2b-256 d397f1dc421a91b2cf4166fc0596096204f683fe4e47817a88b52e73709c8ecd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: actipy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.13

File hashes

Hashes for actipy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f362585881ea63718aa2e9d079af3d06b836875777e587c4fc80f6b7dc81eb7b
MD5 7f090e5c8998e62cc3ce3479182df7aa
BLAKE2b-256 946a2f0eb868c922d3ae6d9790125271ca382c302ef126d8712d17ff385cf633

See more details on using hashes here.

Supported by

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