Skip to content

Commit 98722a5

Browse files
committed
Fix maxwell gain_uV when lsb is not in settings - 2
1 parent 5d66db8 commit 98722a5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

neo/rawio/maxwellrawio.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,16 @@ def _parse_header(self):
9191
for stream_id in signal_streams['id']:
9292
if int(version) == 20160704:
9393
sr = 20000.
94-
gain_uV = h5['settings']['lsb'][0] * 1e6
94+
settings = h5["settings"]
95+
if 'lsb' in settings:
96+
gain_uV = settings['lsb'][:][0] * 1e6
97+
else:
98+
if "gain" not in settings:
99+
print("'gain' amd 'lsb' not found in settings. Setting gain to 512 (default)")
100+
gain = 512
101+
else:
102+
gain = settings['gain'][:][0]
103+
gain_uV = 3.3 / (1024 * gain) * 1e6
95104
sigs = h5['sig']
96105
mapping = h5["mapping"]
97106
ids = np.array(mapping['channel'])

0 commit comments

Comments
 (0)