added comments, validated code to pep8
This commit is contained in:
parent
f8ab552f3e
commit
28d92c0574
14
pyedf.py
14
pyedf.py
@ -14,12 +14,14 @@ import re
|
||||
def read_edf_file(fileobj):
|
||||
data = fileobj.read()
|
||||
header = {}
|
||||
header['version'] = data[0:7].strip() # 8
|
||||
header['patient_id'] = data[7:88].strip() # 80
|
||||
header['rec_id'] = data[88:168].strip() # 80
|
||||
header['startdate'] = data[168:176].strip() # 8
|
||||
header['starttime'] = data[176:184].strip() # 8
|
||||
header['header_bytes'] = int(data[184:192].strip()) # 8
|
||||
# Parse header information based on the EDF/EDF+ specs
|
||||
# http://www.edfplus.info/specs/index.html
|
||||
header['version'] = data[0:7].strip()
|
||||
header['patient_id'] = data[7:88].strip()
|
||||
header['rec_id'] = data[88:168].strip()
|
||||
header['startdate'] = data[168:176].strip()
|
||||
header['starttime'] = data[176:184].strip()
|
||||
header['header_bytes'] = int(data[184:192].strip())
|
||||
header['num_items'] = int(data[236:244].strip())
|
||||
header['data_duration'] = float(data[244:252].strip())
|
||||
header['num_signals'] = int(data[252:256].strip())
|
||||
|
Reference in New Issue
Block a user