Skip to content

Commit 741473b

Browse files
authored
Merge pull request #1685 from h-mayorquin/make_blackrock_main_function_class_attribute
Blackrock make sampling rate a class attribute.
2 parents 9b8e4b4 + 7c86537 commit 741473b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

neo/rawio/blackrockrawio.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ class BlackrockRawIO(BaseRawIO):
130130
extensions.extend(["nev", "sif", "ccf"]) # 'sif', 'ccf' not yet supported
131131
rawmode = "multi-file"
132132

133+
# We need to document the origin of this value
134+
main_sampling_rate = 30000.0
135+
136+
133137
def __init__(
134138
self, filename=None, nsx_override=None, nev_override=None, nsx_to_load=None, load_nev=True, verbose=False
135139
):
@@ -250,7 +254,6 @@ def __init__(
250254

251255
def _parse_header(self):
252256

253-
main_sampling_rate = 30000.0
254257

255258
event_channels = []
256259
spike_channels = []
@@ -298,7 +301,7 @@ def _parse_header(self):
298301
# TODO: Double check if this is the correct assumption (10 samples)
299302
# default value: threshold crossing after 10 samples of waveform
300303
wf_left_sweep = 10
301-
wf_sampling_rate = main_sampling_rate
304+
wf_sampling_rate = self.main_sampling_rate
302305
spike_channels.append((name, _id, wf_units, wf_gain, wf_offset, wf_left_sweep, wf_sampling_rate))
303306

304307
# scan events
@@ -392,7 +395,7 @@ def _parse_header(self):
392395
_data_reader_fun = self.__nsx_data_reader[spec]
393396
self.nsx_datas[nsx_nb] = _data_reader_fun(nsx_nb)
394397

395-
sr = float(main_sampling_rate / self.__nsx_basic_header[nsx_nb]["period"])
398+
sr = float(self.main_sampling_rate / self.__nsx_basic_header[nsx_nb]["period"])
396399
self.sig_sampling_rates[nsx_nb] = sr
397400

398401
if spec in ["2.2", "2.3", "3.0"]:

0 commit comments

Comments
 (0)