Load and analyze Delsys CSV exports as ``pysampled.Data`` time series.
Project description
delsys
Load Delsys CSV exports into Python as pysampled.Data time series.
delsys reads CSV files exported from EMGworks and Trigno Discover, normalizes their
many per-format quirks (header layouts, sub-channel orderings, link-device
asynchrony), resamples each channel to a configurable per-modality target
rate, and groups the result into per-sensor modality bundles (EMG, EKG,
IMU, FSR, VO2 Master, HR Strap, Analog) ready for analysis.
Installation
pip install delsys
For local development:
git clone https://github.com/praneethnamburi/delsys
pip install -e "./delsys[dev]"
Quickstart
import delsys
lf = delsys.Log("path/to/Trial.csv", sensor_map="path/to/delsys_channelmap.txt")
# Direct accessors — list of typed bundles, one per sensor with that modality.
lf.emg # list of EMG bundles
lf.ekg # list of EKG bundles
lf.acc, lf.gyro # tri-axial IMU bundles
lf.fsr # 4-channel FSR bundles
lf.analog # raw Analog signals
lf.vo2master # VO2 Master link device (8 channels)
lf.hrstrap # HR Strap link device
# Side accessors return whole Sensor objects.
lf.left, lf.right, lf.center
# Filtered queries.
lf.find(modality="EMG", side="R") # right-side EMG bundles
lf.find(location="Forearm") # any sensor at "Forearm"
lf.find(sensor_number=5)
lf.find(modality="EMG", as_="signal") # raw per-channel Signal objects
# A typical EMG envelope pipeline.
for emg in lf.emg:
envelope = emg.process(amp_kind="envelope2")
rms = emg.rms(envelope_sr=240) # clean RMS amplitude pipeline
See the full API reference at https://delsys.readthedocs.io.
Channelmap files (optional)
When you pass sensor_map="path/to/delsys_channelmap.txt" to Log(), that
file labels each sensor number with a sensor type and a body-location tag.
This lets you query by side (lf.find(side="R")) and by location
(lf.find(location="Forearm")).
The format is one sensor per line, three fields separated by " - ":
Ch 1 - EMG - LBicep
Ch 2 - EMG - RBicep
Ch 11 - EKG - Chest
Ch 12 - Sync - Optitrack Recording Gate
Ch 19 - Quattro - LForearmExtensors (A-Index, B-Middle, C-Ring, D-Little)
Ch 21 - FSR - LFoot (1-Heel, 2-OuterEdge, 3-Ball, 4-Toe)
- Field 1: any text whose last whitespace-token is the sensor's channel
number (
Ch 1,Channel 01,1all work). - Field 2: a type tag (free text — common values:
EMG,Quattro,Snap,EKG,FSR,Sync). - Field 3: a location label. Its first character is interpreted as the
side (
L/R/Cfor left/right/center). Anything else still loads but won't matchlf.find(side=...).
Trailing parenthetical notes are informational only — they remain in
location but the parser doesn't extract sub-channel labels from them.
Blank lines and lines without two " - " separators are silently skipped.
A more comprehensive reference file lives at
examples/delsys_channelmap.txt.
Supported export formats
- EMGworks
- Trigno Discover 1.4.2
- Trigno Discover 1.5.0
- Trigno Discover 1.6.4 (with and without link devices)
- Trigno Discover 1.7.0
Supported sensors
EMG (Avanti single, Duo, Quattro, Snap-Lead), EKG, ACC, GYRO, FSR, Analog, VO2 Master (link), HR Strap (link).
Scope and contributions
Supported sensor types are limited to those the maintainer has access to.
Delsys ships other hardware (e.g. SmO2/Thb appear as stubs in TARGET_SR
but are not exercised end-to-end). Contributions adding parsers and tests
for additional sensors are very welcome.
If you'd like to contribute, the dev install above pulls pytest, black,
and isort. Format with black and isort before opening a PR:
isort src/ tests/ scripts/
black src/ tests/ scripts/
pytest
License
Distributed under the MIT License. See LICENSE for details.
Contact
Project link: https://github.com/praneethnamburi/delsys
Acknowledgments
This package was developed as part of the ImmersionToolbox initiative at the MIT.nano Immersion Lab. Thanks to NCSOFT for supporting this initiative.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file delsys-0.1.0.tar.gz.
File metadata
- Download URL: delsys-0.1.0.tar.gz
- Upload date:
- Size: 363.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f31de43a839a003ddcf31d7bc7a1641c1a8307d3a5bef0c5663beb373ec924cb
|
|
| MD5 |
47e0453eff037cf433a20f0af2cfbe90
|
|
| BLAKE2b-256 |
7643e44735497087295b716e0edc394967b05b4ad50594ec35c8facf48d0c840
|
File details
Details for the file delsys-0.1.0-py3-none-any.whl.
File metadata
- Download URL: delsys-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a70ceb386e45bd7a88456644bd91d8894524a863bace28943218e3f926d981c6
|
|
| MD5 |
66729deec52b3c200be55d4b72e47f0f
|
|
| BLAKE2b-256 |
8415f6c8818128249942cd775f47fba5133b515af24874ba9850cd8930cee657
|