Skip to content

Commit 6849994

Browse files
authored
Merge branch 'master' into spikeglx_sync_separate
2 parents 7f09637 + 43f2c36 commit 6849994

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

doc/source/governance.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ The current maintainers are:
3838
- Julia Sprenger (`@JuliaSprenger`_)
3939
- Michael Denker (`@mdenker`_)
4040
- Alessio Buccino (`@alejoe91`_)
41+
- Zach McKenzie (`@zm711`_)
4142

4243

4344
.. _`Neo maintainers team`: https://github.com/orgs/NeuralEnsemble/teams/neo-maintainers
@@ -47,3 +48,4 @@ The current maintainers are:
4748
.. _`@JuliaSprenger`: https://github.com/JuliaSprenger
4849
.. _`@mdenker`: https://github.com/mdenker
4950
.. _`@alejoe91`: https://github.com/alejoe91
51+
.. _`@zm711`: https://github.com/zm711

neo/rawio/blackrockrawio.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,21 @@ def __read_nev_data(self, nev_data_masks, nev_data_types):
12541254
# read all raw data packets and markers
12551255
dt0 = [("timestamp", ts_format), ("packet_id", "uint16"), ("value", f"S{data_size - header_skip}")]
12561256

1257-
raw_data = np.memmap(filename, offset=header_size, dtype=dt0, mode="r")
1257+
# expected number of data packets. We are not sure why, but it seems we can get partial data packets
1258+
# based on blackrock's own code this is okay so applying an int to round down is necessary to obtain the
1259+
# memory map of full packets and toss the partial packet.
1260+
# See reference: https://github.com/BlackrockNeurotech/Python-Utilities/blob/fa75aa671680306788e10d3d8dd625f9da4ea4f6/brpylib/brpylib.py#L580-L587
1261+
n_packets = int(
1262+
(self.__get_file_size(filename) - header_size) / data_size
1263+
)
1264+
1265+
raw_data = np.memmap(
1266+
filename,
1267+
offset=header_size,
1268+
dtype=dt0,
1269+
shape=(n_packets,),
1270+
mode="r",
1271+
)
12581272

12591273
masks = self.__nev_data_masks(raw_data["packet_id"])
12601274
types = self.__nev_data_types(data_size)
@@ -1797,7 +1811,7 @@ def __nev_params(self, param_name):
17971811
hour=self.__nev_basic_header["hour"],
17981812
minute=self.__nev_basic_header["minute"],
17991813
second=self.__nev_basic_header["second"],
1800-
microsecond=self.__nev_basic_header["millisecond"],
1814+
microsecond=int(self.__nev_basic_header["millisecond"]) * 1000,
18011815
),
18021816
"max_res": self.__nev_basic_header["timestamp_resolution"],
18031817
"channel_ids": self.__nev_ext_header[b"NEUEVWAV"]["electrode_id"],

0 commit comments

Comments
 (0)