Skip to content

[Bug] peak_detection without analogsignals.times #613

@Samcrl0

Description

@Samcrl0

Describe the bug
Hello. After acquired data with an Intan, I would like to use Elephant for the first treatment of these.
In this way, I would like to fill the spiketrain object of neo using the spike_extraction method of elephant, which is empty after the acquisition. Then I could realize the spike sorting.
However, Elephant require a list "analogsinal.times" which does not exist in the obect analogsignals of neo.

How the method is supposed to work?

To Reproduce
1.
2.
Traceback (most recent call last):

File ~\anaconda3\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)

File c:\users\clement\desktop\analysis_data\testephy_3.py:63
event = elephant.spike_train_generation.peak_detection(signal_highpassed[0],threshold=-40 * uV, sign="below")

File ~\anaconda3\lib\site-packages\elephant\spike_train_generation.py:321 in peak_detection
result_st = neo.SpikeTrain(events_base, units=signal.times.units,

AttributeError: 'Quantity' object has no attribute 'times'

Expected behavior
I expect that the spike_extraction method put all the spike events in the spiketrains obect.

Environment

  • Windows 11
  • How you installed elephant : pip
  • Python version: 3.10
  • neo python package version: 0.12.0
  • elephant python package version: 1.0.0
  • (Any additional python package you want to include here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions