I don't know the implications of this yet, but worth investigating
Lines 76-82
# Try to read the original file path
try:
assert hdr_lines[1].split()[1:3] == ['File', 'Name']
hdr[u'FileName'] = ' '.join(hdr_lines[1].split()[3:])
# hdr['save_path'] = hdr['FileName']
except:
warnings.warn('Unable to parse original file path from Neuralynx header: ' + hdr_lines[1])
Lines 90-98
# Read the parameters, assuming "-PARAM_NAME PARAM_VALUE" format
for line in hdr_lines[4:]:
try:
name, value = line[1:].split() # Ignore the dash and split PARAM_NAME and PARAM_VALUE
hdr[name] = value
except:
warnings.warn('Unable to parse parameter line from Neuralynx header: ' + line)
return hdr
Lines 128-139
# Parse a datetime object from the idiosyncratic time string in Neuralynx file headers
try:
tmp_date = [int(x) for x in time_string.split()[4].split('/')]
tmp_time = [int(x) for x in time_string.split()[-1].replace('.', ':').split(':')]
tmp_microsecond = tmp_time[3] * 1000
except:
warnings.warn('Unable to parse time string from Neuralynx header: ' + time_string)
return None
else:
return datetime.datetime(tmp_date[2], tmp_date[0], tmp_date[1], # Year, month, day
tmp_time[0], tmp_time[1], tmp_time[2], # Hour, minute, second
tmp_microsecond)
I don't know the implications of this yet, but worth investigating
Lines 76-82
Lines 90-98
Lines 128-139