Skip to content

Commit

Permalink
BUG: Fix bug on CTF + Windows (#10866)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Jun 29, 2022
1 parent b58d6a5 commit 0452d69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Bugs

- Fix bug in :func:`mne.io.read_raw_bti` where unknown electrode locations were not handled properly (:gh:`10662` by `Eric Larson`_)

- Fix bug in :func:`mne.io.read_raw_ctf` on Windows where large files could not be read (:gh:`10866` by `Eric Larson`_)

- Rendering issues with recent MESA releases can be avoided by setting the new environment variable``MNE_3D_OPTION_MULTI_SAMPLES=1`` or using :func:`mne.viz.set_3d_options` (:gh:`10513` by `Eric Larson`_)

- Fix behavior for the ``pyvista`` 3D renderer's ``quiver3D`` function so that default arguments plot a glyph in ``arrow`` mode (:gh:`10493` by `Alex Rockhill`_)
Expand Down
7 changes: 5 additions & 2 deletions mne/io/ctf/ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ def _read_segment_file(self, data, idx, fi, start, stop, cals, mult):
samp_offset = (bi + trial_start_idx) * si['res4_nsamp']
n_read = min(si['n_samp_tot'] - samp_offset, si['block_size'])
# read the chunk of data
pos = CTF.HEADER_SIZE
pos += samp_offset * si['n_chan'] * 4
# have to be careful on Windows and make sure we are using
# 64-bit integers here
with np.errstate(over='raise'):
pos = np.int64(CTF.HEADER_SIZE)
pos += np.int64(samp_offset) * si['n_chan'] * 4
fid.seek(pos, 0)
this_data = np.fromfile(fid, '>i4',
count=si['n_chan'] * n_read)
Expand Down

0 comments on commit 0452d69

Please sign in to comment.