Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ and may not be the current affiliation of a contributor.
* Axel Coiffard-Donaty
* Anthony Mercer
* Aaron Kanzer [53]
* Eva B (evadiva3 on GitHub)

1. Centre de Recherche en Neuroscience de Lyon, CNRS UMR5292 - INSERM U1028 - Université Claude Bernard Lyon 1
2. Unité de Neuroscience, Information et Complexité, CNRS UPR 3293, Gif-sur-Yvette, France
Expand Down
3 changes: 2 additions & 1 deletion neo/rawio/plexonrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def _parse_header(self):
if index == 0:
data_block["cumsum"][index] = 0
else:
data_block["cumsum"][index] = data_block["cumsum"][index - 1] + sample_count
previous_sample_count = data_block["size"][index - 1] // 2
data_block["cumsum"][index] = data_block["cumsum"][index - 1] + previous_sample_count

self._data_blocks[bl_type][chan_id] = data_block

Expand Down
19 changes: 19 additions & 0 deletions neo/test/rawiotest/test_plexonrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ class TestPlexonRawIO(
"plexon/plx/timestamp_clock/one_megahertz_forty_bit_timestamps/sorted_spikes_and_strobed_events.plx",
]

def test_unequal_signal_block_sizes(self):
"""Read across unequal blocks in a real recording."""
reader = PlexonRawIO(filename=self.get_local_path("plexon/File_plexon_3.plx"), progress_bar=False)
reader.parse_header()
blocks = reader._data_blocks[5][0]
sample_counts = blocks["size"] // 2
np.testing.assert_array_equal(np.unique(sample_counts), [86, 120])
starts = np.r_[0, np.cumsum(sample_counts[:-1])]
np.testing.assert_array_equal(blocks["cumsum"], starts)

previous, last = blocks[-2:]
previous_samples = np.frombuffer(
reader._memmap, dtype="int16", count=previous["size"] // 2, offset=previous["pos"]
)
last_samples = np.frombuffer(reader._memmap, dtype="int16", count=last["size"] // 2, offset=last["pos"])
expected = np.r_[previous_samples[-10:], last_samples[:10]]
chunk = reader.get_analogsignal_chunk(i_start=starts[-1] - 10, i_stop=starts[-1] + 10)
np.testing.assert_array_equal(chunk[:, 0], expected)

def test_timestamps_with_lower_word_above_two_to_the_31(self):
"""The lower 32 bits of the 40-bit block timestamp must be read unsigned.

Expand Down