Skip to content

Commit 46c29ba

Browse files
author
Daniel Crepeau
committed
adding MED-specific files
1 parent b9b6b41 commit 46c29ba

File tree

4 files changed

+776
-0
lines changed

4 files changed

+776
-0
lines changed

neo/io/medio.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"""
2+
IO for reading MED datasets using dhn-med-py library.
3+
4+
dhn-med-py
5+
https://medformat.org
6+
https://pypi.org/project/dhn-med-py/
7+
8+
MED Format Specifications: https://medformat.org
9+
10+
Author: Dan Crepeau, Matt Stead
11+
"""
12+
13+
from neo.io.basefromrawio import BaseFromRaw
14+
from neo.rawio.medrawio import MedRawIO
15+
16+
17+
class MedIO(MedRawIO, BaseFromRaw):
18+
"""
19+
IO for reading MED datasets.
20+
"""
21+
name = 'MED IO'
22+
description = "IO for reading MED datasets"
23+
24+
_prefered_signal_group_mode = 'group-by-same-units'
25+
mode = 'dir'
26+
27+
def __init__(self, dirname=None, password=None, keep_original_times=False):
28+
MedRawIO.__init__(self, dirname=dirname, password=password,
29+
keep_original_times=keep_original_times)
30+
"""
31+
Initialise IO instance
32+
33+
Parameters
34+
----------
35+
dirname : str
36+
Directory containing data files
37+
password : str
38+
MED sessions can be optionally encrypted with a password.
39+
Default: None
40+
keep_original_times : bool
41+
Preserve original time stamps as in data files. By default datasets are
42+
shifted to begin at t_start = 0. When set to True, timestamps will be
43+
returned as UTC (seconds since midnight 1 Jan 1970).
44+
Default: False
45+
"""
46+
BaseFromRaw.__init__(self, dirname)
47+
48+
def close(self):
49+
MedRawIO.close(self)
50+
51+
def __del__(self):
52+
MedRawIO.__del__(self)

0 commit comments

Comments
 (0)