Skip to content

Commit 6cb51a4

Browse files
committed
fix preload [ci skip]
1 parent 0b4b92f commit 6cb51a4

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

mne/io/otb/otb.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,21 @@ def _preload_data(self, preload):
264264
sig_fname = _extras["sig_fname"]
265265

266266
with tarfile.open(self.filenames[0], "r") as fid:
267-
self._data = np.frombuffer(
268-
fid.extractfile(sig_fname).read(),
269-
dtype=_extras["dtype"],
267+
_data = (
268+
np.frombuffer(
269+
fid.extractfile(sig_fname).read(),
270+
dtype=_extras["dtype"],
271+
)
272+
.reshape(-1, self.info["nchan"])
273+
.T
270274
)
275+
cals = np.array(
276+
[
277+
_ch["cal"] * _ch["range"] * _ch.get("scale", 1.0)
278+
for _ch in self.info["chs"]
279+
]
280+
)
281+
self._data = _data * cals[:, np.newaxis]
271282

272283

273284
@fill_doc

0 commit comments

Comments
 (0)