Skip to content

Commit

Permalink
Fix 2048 offset
Browse files Browse the repository at this point in the history
  • Loading branch information
b-grimaud committed Nov 15, 2023
1 parent ff97327 commit 029a790
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions neo/rawio/biocamrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
See:
https://www.3brain.com/products/single-well/biocam-x
Author : Alessio Buccino
Authors: Alessio Buccino, Robert Wolff, Baptiste Grimaud
"""

from .baserawio import (BaseRawIO, _signal_channel_dtype, _signal_stream_dtype,
Expand Down Expand Up @@ -145,14 +145,14 @@ def open_biocam_file_header(filename):
if format_100:
if signal_inv == 1:
read_function = readHDF5t_100
elif signal_inv == 1:
elif signal_inv == -1:
read_function = readHDF5t_100_i
else:
raise Exception("Unknown signal inversion")
else:
if signal_inv == 1:
read_function = readHDF5t_101
elif signal_inv == 1:
elif signal_inv == -1:
read_function = readHDF5t_101_i
else:
raise Exception("Unknown signal inversion")
Expand All @@ -166,16 +166,16 @@ def open_biocam_file_header(filename):


def readHDF5t_100(rf, t0, t1, nch):
return rf['3BData/Raw'][t0:t1]
return rf['3BData/Raw'][t0:t1].astype(np.int16) - 2048


def readHDF5t_100_i(rf, t0, t1, nch):
return 4096 - rf['3BData/Raw'][t0:t1]
return 2048 - rf['3BData/Raw'][t0:t1].astype(np.int16)


def readHDF5t_101(rf, t0, t1, nch):
return rf['3BData/Raw'][nch * t0:nch * t1].reshape((t1 - t0, nch), order='C')
return rf['3BData/Raw'][nch * t0:nch * t1].reshape((t1 - t0, nch), order='C').astype(np.int16) - 2048


def readHDF5t_101_i(rf, t0, t1, nch):
return 4096 - rf['3BData/Raw'][nch * t0:nch * t1].reshape((t1 - t0, nch), order='C')
return 2048 - rf['3BData/Raw'][nch * t0:nch * t1].reshape((t1 - t0, nch), order='C').astype(np.int16)

0 comments on commit 029a790

Please sign in to comment.