Compare commits
2 Commits
11d76b205a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 32487e09a9 | |||
|
|
d9aed0551f |
@@ -1,21 +1,11 @@
|
|||||||
import logging
|
import logging
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
|
||||||
import nixio
|
import nixio
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import rlxnix as rlx
|
|
||||||
import spikeinterface.core as si
|
import spikeinterface.core as si
|
||||||
from IPython import embed
|
|
||||||
from neo.io import OpenEphysBinaryIO
|
|
||||||
from nixio.exceptions import DuplicateName
|
from nixio.exceptions import DuplicateName
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
from rich.table import Table
|
|
||||||
from rlxnix.plugins.efish.utils import extract_am
|
|
||||||
from scipy import signal
|
|
||||||
|
|
||||||
from oephys2nix.metadata import create_dict_from_section, create_metadata_from_dict
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
console = Console()
|
console = Console()
|
||||||
@@ -46,6 +36,7 @@ class AppendSorting:
|
|||||||
self.sorting, mode="extremum", peak_sign="neg", outputs="index"
|
self.sorting, mode="extremum", peak_sign="neg", outputs="index"
|
||||||
)
|
)
|
||||||
self.data = self.block.data_arrays["data"]
|
self.data = self.block.data_arrays["data"]
|
||||||
|
self._clean()
|
||||||
self.append_sorting_to_recording()
|
self.append_sorting_to_recording()
|
||||||
|
|
||||||
def append_sorting_to_recording(self):
|
def append_sorting_to_recording(self):
|
||||||
@@ -87,6 +78,19 @@ class AppendSorting:
|
|||||||
f"unit-{unit}", "sorting.spike_index", multi_tag_positions
|
f"unit-{unit}", "sorting.spike_index", multi_tag_positions
|
||||||
)
|
)
|
||||||
multi_tag.references.append(self.data)
|
multi_tag.references.append(self.data)
|
||||||
|
gr.mulit_tags.append(positions)
|
||||||
|
|
||||||
|
def _clean(self):
|
||||||
|
try:
|
||||||
|
gr = self.block.groups["units"]
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
|
|
||||||
|
for das in gr.data_arrays:
|
||||||
|
del self.das[das.name]
|
||||||
|
for mtag in gr.multi_tags:
|
||||||
|
del self.block.mulit_tags[mtag.name]
|
||||||
|
del self.das[mtag.name + "-positions"]
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.nixfile.close()
|
self.nixfile.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user