Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Neo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NeuralEnsemble
Neo
Commits
129da571
Unverified
Commit
129da571
authored
2 weeks ago
by
Zach McKenzie
Committed by
GitHub
2 weeks ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1690 from luiztauffer/fix-blackrock-overflow
Blackrock rawio fix overflow
parents
008cbe87
96041838
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
neo/rawio/blackrockrawio.py
+8
-8
8 additions, 8 deletions
neo/rawio/blackrockrawio.py
with
8 additions
and
8 deletions
neo/rawio/blackrockrawio.py
+
8
−
8
View file @
129da571
...
...
@@ -1058,8 +1058,8 @@ class BlackrockRawIO(BaseRawIO):
filename
=
"
.
"
.
join
([
self
.
_filenames
[
"
nsx
"
],
f
"
ns
{
nsx_nb
}
"
])
# get shape of data
shape
=
(
self
.
__nsx_params
[
"
2.1
"
](
nsx_nb
)[
"
nb_data_points
"
],
self
.
__nsx_basic_header
[
nsx_nb
][
"
channel_count
"
])
offset
=
self
.
__nsx_params
[
"
2.1
"
](
nsx_nb
)[
"
bytes_in_headers
"
]
shape
=
(
int
(
self
.
__nsx_params
[
"
2.1
"
](
nsx_nb
)[
"
nb_data_points
"
]
)
,
int
(
self
.
__nsx_basic_header
[
nsx_nb
][
"
channel_count
"
])
)
offset
=
int
(
self
.
__nsx_params
[
"
2.1
"
](
nsx_nb
)[
"
bytes_in_headers
"
]
)
# read nsx data
# store as dict for compatibility with higher file specs
...
...
@@ -1078,10 +1078,10 @@ class BlackrockRawIO(BaseRawIO):
for
data_bl
in
self
.
__nsx_data_header
[
nsx_nb
].
keys
():
# get shape and offset of data
shape
=
(
self
.
__nsx_data_header
[
nsx_nb
][
data_bl
][
"
nb_data_points
"
],
self
.
__nsx_basic_header
[
nsx_nb
][
"
channel_count
"
],
int
(
self
.
__nsx_data_header
[
nsx_nb
][
data_bl
][
"
nb_data_points
"
]
)
,
int
(
self
.
__nsx_basic_header
[
nsx_nb
][
"
channel_count
"
]
)
,
)
offset
=
self
.
__nsx_data_header
[
nsx_nb
][
data_bl
][
"
offset_to_data_block
"
]
offset
=
int
(
self
.
__nsx_data_header
[
nsx_nb
][
data_bl
][
"
offset_to_data_block
"
]
)
# read data
data
[
data_bl
]
=
np
.
memmap
(
filename
,
dtype
=
"
int16
"
,
shape
=
shape
,
offset
=
offset
,
mode
=
"
r
"
)
...
...
@@ -1828,7 +1828,7 @@ class BlackrockRawIO(BaseRawIO):
"""
filebuf
=
open
(
filename
,
"
rb
"
)
filebuf
.
seek
(
0
,
os
.
SEEK_END
)
file_size
=
filebuf
.
tell
()
file_size
=
int
(
filebuf
.
tell
()
)
filebuf
.
close
()
return
file_size
...
...
@@ -2007,8 +2007,8 @@ class BlackrockRawIO(BaseRawIO):
nsx_parameters
=
{
"
nb_data_points
"
:
int
(
(
self
.
__get_file_size
(
filename
)
-
bytes_in_headers
)
/
(
2
*
self
.
__nsx_basic_header
[
nsx_nb
][
"
channel_count
"
])
(
int
(
self
.
__get_file_size
(
filename
)
)
-
int
(
bytes_in_headers
)
)
/
int
(
2
*
self
.
__nsx_basic_header
[
nsx_nb
][
"
channel_count
"
])
-
1
),
"
labels
"
:
labels
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment