Plot_traces does not work with different sampling rates
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 57/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start in src/spikeinterface/widgets/traces.py near line 268, where the issue says sample indices for recordings are derived using the first recording's sampling rate. Trace how plot_traces handles time ranges and sample indices for each recording, then check the relevant widget tests. Done means recordings with different sampling rates display aligned time ranges correctly.
索引モデルが issue の本文から書いたものです。
説明
Hi guys,
I was playing around with the plot_traces function to compare the effects of LFP preprocessing from the broadband signal.
These are the steps I perform for the preprocessing:
def preprocess_lfp(
recording,
lfp_fs=1000,
lfp_low=1,
lfp_high=300,
reference="global",
operator="median",
):
"""
Preprocess broadband LFP from a SpikeInterface recording.
Steps:
1. Bandpass filter (default 1-300 Hz)
2. Common median reference (default)
3. Downsample to LFP sampling rate
Parameters
----------
recording : BaseRecording
Input SpikeInterface recording.
lfp_fs : int, default=1000
Output sampling rate.
lfp_low : float, default=1
Lower cutoff frequency.
lfp_high : float, default=300
Upper cutoff frequency.
reference : str, default='global'
Reference mode for common_reference().
operator : str, default='median'
Reference operator ('median' or 'average').
Returns
-------
lfp : BaseRecording
Preprocessed broadband LFP recording.
"""
# Bandpass filter
lfp = si.bandpass_filter(
recording,
freq_min=lfp_low,
freq_max=lfp_high,
margin_ms=5000,
filter_order=2,
ftype="butter",
ignore_low_freq_error=True,
)
# Common reference
lfp = si.common_reference(
recording=lfp,
reference=reference,
operator=operator,
)
# Downsample
lfp = si.resample(
recording=lfp,
resample_rate=lfp_fs,
margin_ms=200,
)
return lfp
and then I simply try to plot the results:
rec_plot = si.plot_traces(
{"Broad": HPC_recording, "LFP": HPC_LFP},
order_channel_by_depth=True,
backend="ipywidgets",
)
Broadband recording
LFP recording
It seems that the plot_traces function uses the sampling rate of the first recording and then defines the samples for all subsequent recordings using that same sampling rate.
I don't know if this is something you might be interested in fixing, but I just wanted to let you know this is a behavior of the function.
Cheers,
Juan
- 主要言語
- Python
- スター
- 883
- フォーク
- 291
- 平均マージ
- 3日 17時間
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SpikeInterface/spikeinterface のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SpikeInterface/spikeinterface#5008 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
SpikeInterface/spikeinterface#5007 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
SpikeInterface/spikeinterface#5006 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SpikeInterface/spikeinterface#5005 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SpikeInterface/spikeinterface#5004 ·
メンテナーはふだん 2 日以内に返信
SpikeInterface/spikeinterface の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
daniel-ospina/tortoise#15308 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
difficulty:easy prio:low type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NatronGitHub/Natron#2405 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Jstar269/nakagawa-recomp#3746 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信