Skip to content

Commit afb4bad

Browse files
committed
voltage.destripe_lfp defaults parameters
1 parent 590dbc2 commit afb4bad

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

brainbox/io/spikeglx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def stream(pid, t0, nsecs=1, one=None, cache_folder=None, remove_cached=False, t
137137
with open(ch_file) as fid:
138138
chinfo = json.load(fid)
139139
tbounds = np.array(chinfo['chunk_bounds']) / chinfo['sample_rate']
140-
first_chunk = np.maximum(0, np.searchsorted(tbounds, t0) - 1)
141-
last_chunk = np.maximum(0, np.searchsorted(tbounds, t0 + nsecs) - 2)
140+
first_chunk = np.maximum(0, np.searchsorted(tbounds, t0 + 0.01) - 1)
141+
last_chunk = np.maximum(0, np.searchsorted(tbounds, t0 + + 0.01 + nsecs) - 2)
142142
t0 = tbounds[first_chunk]
143143

144144
samples_folder.mkdir(exist_ok=True, parents=True)

ibllib/dsp/voltage.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,19 @@ def destripe(x, fs, neuropixel_version=1, butter_kwargs=None, k_kwargs=None, cha
280280
return x
281281

282282

283-
def destripe_lfp(x, fs):
283+
def destripe_lfp(x, fs, channel_labels=None, **kwargs):
284284
"""
285285
Wrapper around the destipe function with some default parameters to destripe the LFP band
286+
See help destripe function for documentation
286287
:param x:
287288
:param fs:
288289
:return:
289290
"""
290-
butter_kwargs = {'N': 3, 'Wn': 2 / fs * 2, 'btype': 'highpass'}
291-
k_kwargs = {'ntr_pad': 60, 'ntr_tap': 0, 'lagc': None,
292-
'butter_kwargs': {'N': 3, 'Wn': 0.001, 'btype': 'highpass'}}
293-
# butterworth, for display only
294-
channel_labels, channel_features = detect_bad_channels(x, fs=fs, psd_hf_threshold=1.4)
295-
return destripe(x, fs, butter_kwargs=butter_kwargs, channel_labels=channel_labels, k_kwargs=k_kwargs)
291+
kwargs['butter_kwargs'] = {'N': 3, 'Wn': 2 / fs * 2, 'btype': 'highpass'}
292+
kwargs['k_filter'] = False
293+
if channel_labels is True:
294+
kwargs['channel_labels'], _ = detect_bad_channels(x, fs=fs, psd_hf_threshold=1.4)
295+
return destripe(x, fs, **kwargs)
296296

297297

298298
def decompress_destripe_cbin(sr_file, output_file=None, h=None, wrot=None, append=False, nc_out=None, butter_kwargs=None,

0 commit comments

Comments
 (0)