Skip to content

Commit 5d66db8

Browse files
committed
Fix maxwell gain_uV when lsb is not in settings
1 parent 400c042 commit 5d66db8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

neo/rawio/maxwellrawio.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,15 @@ def _parse_header(self):
100100
elif int(version) > 20160704:
101101
settings = h5['wells'][stream_id][self.rec_name]['settings']
102102
sr = settings['sampling'][:][0]
103-
gain_uV = settings['lsb'][:][0] * 1e6
103+
if 'lsb' in settings:
104+
gain_uV = settings['lsb'][:][0] * 1e6
105+
else:
106+
if "gain" not in settings:
107+
print("'gain' amd 'lsb' not found in settings. Setting gain to 512 (default)")
108+
gain = 512
109+
else:
110+
gain = settings['gain'][:][0]
111+
gain_uV = 3.3 / (1024 * gain) * 1e6
104112
mapping = settings['mapping']
105113
sigs = h5['wells'][stream_id][self.rec_name]['groups']['routed']['raw']
106114

0 commit comments

Comments
 (0)